Skip to content

Commit

Permalink
[JVM] Restore old implementation of 'lazy gather'
Browse files Browse the repository at this point in the history
The performance optimization of 971174f broke things on the JVM
backend. This is a known problem with nqp::null getting HLLized
showing up again -- cmp. #1613
  • Loading branch information
usev6 committed Dec 29, 2019
1 parent a5fdf1d commit 131d253
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core.c/Rakudo/Iterator.pm6
Expand Up @@ -2234,17 +2234,29 @@ class Rakudo::Iterator {
}

method pull-one() is raw {
#?if !jvm
nqp::ifnull(
$!iterator,
$!iterator := $!iterable.iterator
).pull-one
#?endif
#?if jvm
$!iterator := $!iterable.iterator unless $!iterator.DEFINITE;
$!iterator.pull-one
#?endif
}

method push-exactly(\target, int $n) {
#?if !jvm
nqp::ifnull(
$!iterator,
$!iterator := $!iterable.iterator
).push-exactly(target, $n);
#?endif
#?if jvm
$!iterator := $!iterable.iterator unless $!iterator.DEFINITE;
$!iterator.push-exactly(target, $n);
#?endif
}

method is-lazy(--> True) { }
Expand Down

0 comments on commit 131d253

Please sign in to comment.