Skip to content

Commit

Permalink
Revert "Replace HyperToIterator.push-all by push-exactly"
Browse files Browse the repository at this point in the history
This reverts commit ec5416a.

This appears to fix GH R#1740 and possibly GH R#1709
  • Loading branch information
lizmat committed Apr 18, 2018
1 parent ceeb3a0 commit 0579669
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/core/Rakudo/Internals/HyperToIterator.pm6
Expand Up @@ -71,7 +71,7 @@ my class Rakudo::Internals::HyperToIterator does Rakudo::Internals::HyperJoiner

method skip-at-least(int $skipping) {
my int $toskip = $skipping;
loop {
while $toskip {
if nqp::isge_i(nqp::elems($!current-items),$toskip) {
nqp::splice($!current-items,EMPTY_BUFFER,0,$toskip);
return 1;
Expand All @@ -90,21 +90,12 @@ my class Rakudo::Internals::HyperToIterator does Rakudo::Internals::HyperJoiner
}
}
}
0
}

method push-exactly($target, int $pushing) {
my int $topush = $pushing;
my int $pushed = 0;
method push-all($target) {
loop {
if nqp::isge_i(nqp::elems($!current-items),$topush) {
$target.append(
nqp::clone(nqp::setelems($!current-items,$topush))
);
nqp::splice($!current-items,EMPTY_BUFFER,0,$topush);
return $pushed + $topush;
}
$target.append($!current-items);
$pushed = $pushed + nqp::elems($!current-items);
$!current-items := $!batches.receive.items;
self.batch-used();

Expand Down

0 comments on commit 0579669

Please sign in to comment.