From a26f51361bfea213fa59749d7a401e09c8f2ef31 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Mon, 16 Jan 2017 10:46:19 +0100 Subject: [PATCH] Make Xop about 7x faster Except for the Xand family, which is still using the old code. --- src/core/metaops.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/metaops.pm b/src/core/metaops.pm index fb03e3e7992..8a60e23b356 100644 --- a/src/core/metaops.pm +++ b/src/core/metaops.pm @@ -18,8 +18,7 @@ sub METAOP_REVERSE(\op) { } sub METAOP_CROSS(\op, &reduce) { - return &infix: if op === &infix:<,>; - + nqp::if(op.prec('thunky').starts-with('.'), -> +lol { my $rop = lol.elems == 2 ?? op !! &reduce(op); my $laze = False; @@ -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) {