feat: add isEmpty method to Sequence class with efficient early-termination check

This commit is contained in:
Bob Nystrom
2015-06-30 13:52:29 +00:00
parent d04e6a61a6
commit 1dc1c4e2bf
4 changed files with 21 additions and 0 deletions
+2
View File
@@ -52,6 +52,8 @@ class Sequence {
}
}
isEmpty { iterate(null) ? false : true }
map(transformation) { new MapSequence(this, transformation) }
where(predicate) { new WhereSequence(this, predicate) }