Skip to content

Commit

Permalink
Make Xop about 7x faster
Browse files Browse the repository at this point in the history
Except for the Xand family, which is still using the old code.
  • Loading branch information
lizmat committed Jan 16, 2017
1 parent 2e80df0 commit a26f513
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/metaops.pm
Expand Up @@ -18,8 +18,7 @@ sub METAOP_REVERSE(\op) {
}

sub METAOP_CROSS(\op, &reduce) {
return &infix:<X> if op === &infix:<,>;

nqp::if(op.prec('thunky').starts-with('.'),
-> +lol {
my $rop = lol.elems == 2 ?? op !! &reduce(op);
my $laze = False;
Expand Down Expand Up @@ -71,7 +70,11 @@ sub METAOP_CROSS(\op, &reduce) {
}
}
}.lazy-if($laze);
},
-> +lol {
Seq.new(Rakudo::Iterator.CrossIterablesOp(lol,op))
}
)
}

sub METAOP_ZIP(\op, &reduce) {
Expand Down

0 comments on commit a26f513

Please sign in to comment.