Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast.…
… This makes it faster. Another little bit of masak++'s program.
  • Loading branch information
jnthn committed Apr 15, 2012
1 parent de1eaf5 commit d6cd1e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/MapIter.pm
Expand Up @@ -34,7 +34,7 @@ my class MapIter is Iterator {
my $block := nqp::p6decont($!block); ### TODO: Why?
my $munched := $!list.munch($argc * $count);
my $NEXT;
if $block.?phasers('NEXT') -> @NEXT {
if pir::can__IPs($block, 'phasers') && $block.phasers('NEXT') -> @NEXT {
if @NEXT.elems == 1 {
$NEXT := @NEXT[0];
}
Expand All @@ -45,7 +45,7 @@ my class MapIter is Iterator {
}
}
unless $!followup {
if $block.?phasers('FIRST') {
if pir::can__IPs($block, 'phasers') && $block.phasers('FIRST') {
pir::perl6_set_block_first_flag__vP($block);
}
}
Expand Down Expand Up @@ -126,7 +126,7 @@ my class MapIter is Iterator {
nqp::bindattr_i($iter, MapIter, '$!followup', 1);
nqp::push($rpa, $iter);
}
elsif $block.?phasers('LAST') -> @LAST {
elsif pir::can__IPs($block, 'phasers') && $block.phasers('LAST') -> @LAST {
.() for @LAST;
}
$!reified := nqp::p6parcel($rpa, nqp::null());
Expand Down

0 comments on commit d6cd1e2

Please sign in to comment.