Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
map: make it work for multis
applies that same heuristic as nom:
$count = 1 if $count == Inf || $count == 0;
  • Loading branch information
moritz committed Aug 23, 2015
1 parent a959024 commit 212d8f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Any-iterable-methods.pm
Expand Up @@ -79,7 +79,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;
if $count <= 1 {
$count = 1 if $count == Inf || $count == 0;
if $count == 1 {
# XXX We need a funkier iterator to care about phasers. Will
# put that on a different code-path to keep the commonest
# case fast.
Expand Down

0 comments on commit 212d8f4

Please sign in to comment.