Created
September 17, 2015 09:49
-
-
Save niner/e82fd8f33ca4c465477c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/Seq.pm b/src/core/Seq.pm | |
index 9abe327..a5e8fe4 100644 | |
--- a/src/core/Seq.pm | |
+++ b/src/core/Seq.pm | |
@@ -48,10 +48,15 @@ my class Seq is Cool does Iterable does PositionalBindFailover { | |
method is-ready(Seq:D:) { $!iter.DEFINITE } | |
method iterator(Seq:D:) { | |
- my \iter = $!iter; | |
- X::Seq::Consumed.new.throw unless iter.DEFINITE; | |
- $!iter := Iterator; | |
- iter | |
+ if $!list.DEFINITE { | |
+ $!list.iterator | |
+ } | |
+ else { | |
+ my \iter = $!iter; | |
+ X::Seq::Consumed.new.throw unless iter.DEFINITE; | |
+ $!iter := Iterator; | |
+ iter | |
+ } | |
} | |
method is-lazy(Seq:D:) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment