Skip to content

Commit

Permalink
Streamline creation of HyperWorkBatchIterator a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jun 10, 2018
1 parent 5621b26 commit 20bf96f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/Rakudo/Internals/HyperWorkBatch.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ my class Rakudo::Internals::HyperWorkBatch does Iterable {
has int $!i;
has int $!n;

submethod BUILD(:$items --> Nil) {
$!items := nqp::decont($items);
method !SET-SELF(\items) {
$!items := items;
$!i = -1;
$!n = nqp::elems($!items);
$!n = nqp::elems(items);
self
}
method new(\items) { nqp::create(self)!SET-SELF(items) }

method pull-one() {
++$!i < $!n
Expand All @@ -42,7 +44,7 @@ my class Rakudo::Internals::HyperWorkBatch does Iterable {
}

method iterator(--> Iterator) {
HyperWorkBatchIterator.new(:$!items)
HyperWorkBatchIterator.new($!items)
}

method replace-with(IterationBuffer $ib --> Nil) {
Expand Down

0 comments on commit 20bf96f

Please sign in to comment.