Skip to content

Commit

Permalink
Give HyperToIterator its own push-all
Browse files Browse the repository at this point in the history
Should help a bit in the my @A = foo.hyper.bar case.
  • Loading branch information
lizmat committed Mar 20, 2018
1 parent 3420b67 commit 34b294d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/core/Rakudo/Internals/HyperToIterator.pm6
Expand Up @@ -92,6 +92,24 @@ my class Rakudo::Internals::HyperToIterator does Rakudo::Internals::HyperJoiner
}
0
}

method push-all($target) {
loop {
$target.append($!current-items);
$!current-items := $!batches.receive.items;
self.batch-used();

CATCH {
when X::Channel::ReceiveOnClosed {
return IterationEnd;
}
default {
($_ but X::HyperRace::Died(Backtrace.new(5))).rethrow
unless nqp::istype($_, X::HyperRace::Died);

This comment has been minimized.

Copy link
@b2gills

b2gills Mar 26, 2018

Contributor

This doesn't rethrow if $_ is already X::HyperRace::Died; is that intentional?

This comment has been minimized.

Copy link
@lizmat

lizmat Mar 26, 2018

Author Contributor

Good question: I think I cargo-culted this from somewhere else.

}
}
}
}
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit 34b294d

Please sign in to comment.