Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Some comments + code legibility
  • Loading branch information
lizmat committed Oct 2, 2015
1 parent d028dae commit e19a521
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/Any-iterable-methods.pm
Expand Up @@ -84,6 +84,8 @@ augment class Any {
# We want map to be fast, so we go to some effort to build special
# case iterators that can ignore various interesting cases.
my $count = &block.count;

# "loop" taking 0 or 1 parameter
if $count == 1 || $count == 0 || $count === Inf {
Seq.new(class :: does MapIterCommon {
has $!did-init;
Expand Down Expand Up @@ -211,6 +213,8 @@ augment class Any {
}
}.new(&block, source, 1, $label));
}

# loop/map taking more than 1 param
else {
Seq.new(class :: does MapIterCommon {
has $!value-buffer;
Expand Down Expand Up @@ -278,7 +282,10 @@ augment class Any {
?? ($result := IterationEnd)
!! ($redo = 1)),
'REDO', $redo = 1,
'LAST', nqp::stmts(($!did-iterate = 1), ($result := IterationEnd))
'LAST', nqp::stmts(
($!did-iterate = 1),
($result := IterationEnd)
)
)
),
:nohandler);
Expand Down

0 comments on commit e19a521

Please sign in to comment.