Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix "Seq has already been iterated" sinking a spent Seq
The sink-all is only there to actually run lazily executed code when the
results are sunk. If the Seq has already been iterated we don't have to
bother.
  • Loading branch information
niner committed Aug 26, 2015
1 parent 2a52091 commit 465b18b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/Seq.pm
Expand Up @@ -102,7 +102,7 @@ my class Seq is Cool does Iterable does PositionalBindFailover {
}

method sink() {
self.iterator.sink-all;
self.iterator.sink-all if $!iter.DEFINITE;
Nil
}

Expand Down

0 comments on commit 465b18b

Please sign in to comment.