Skip to content

Commit

Permalink
Merge pull request #1400 from jstuder-gh/issue_1397_ords_rotor
Browse files Browse the repository at this point in the history
Issue 1397: Reifiy pending elements in Seq prior to rotor call
  • Loading branch information
zoffixznet committed Jan 14, 2018
2 parents 029226f + 4a82b4b commit 1ed8f5d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/Rakudo/Iterator.pm
Expand Up @@ -2795,6 +2795,7 @@ class Rakudo::Iterator {
has $!cycle;
has $!buffer;
has int $!complete;
has int $!is-exhausted = 0;
method !SET-SELF(\iterator,\cycle,\partial) {
nqp::stmts(
($!iterator := iterator),
Expand All @@ -2812,6 +2813,9 @@ class Rakudo::Iterator {
)
}
method pull-one() is raw {
nqp::if(
$!is-exhausted,
IterationEnd,
nqp::stmts(
nqp::if(
nqp::istype((my $todo := $!cycle.pull-one),Pair),
Expand Down Expand Up @@ -2896,6 +2900,7 @@ class Rakudo::Iterator {
nqp::if(
nqp::not_i(nqp::elems($!buffer))
|| (nqp::eqaddr($pulled,IterationEnd)
&& ($!is-exhausted = 1)
&& $!complete
&& nqp::islt_i(nqp::elems($!buffer),$elems)
),
Expand Down Expand Up @@ -2946,6 +2951,7 @@ class Rakudo::Iterator {
)
)
)
)
}
method is-lazy() { $!iterator.is-lazy }
}.new(iterator,cycle,partial)
Expand Down

0 comments on commit 1ed8f5d

Please sign in to comment.