From 87de5ee4686e3d66acc350b51aaef310267db6bb Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Sat, 4 Jan 2020 15:19:17 +0100 Subject: [PATCH] Don't handle 1-element lists differently with cross --- src/core.c/Rakudo/Iterator.pm6 | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/core.c/Rakudo/Iterator.pm6 b/src/core.c/Rakudo/Iterator.pm6 index 6d5af3f7ce9..a687cf7a771 100644 --- a/src/core.c/Rakudo/Iterator.pm6 +++ b/src/core.c/Rakudo/Iterator.pm6 @@ -1082,19 +1082,9 @@ class Rakudo::Iterator { } method CrossIterables(@iterables) { nqp::if( - nqp::isgt_i((my int $n = @iterables.elems),1), # reifies - - # actually need to do some crossing (probably) + nqp::isgt_i(@iterables.elems,0), # reifies CrossIterables.new(@iterables), - - # simpler cases - nqp::if( - nqp::iseq_i($n,0), - # nothing to cross, so return an empty list - Rakudo::Iterator.Empty, - # only 1 list to cross, which is the list itself - nqp::atpos(nqp::getattr(@iterables,List,'$!reified'),0).iterator - ) + Rakudo::Iterator.Empty ) } @@ -4019,9 +4009,9 @@ class Rakudo::Iterator { } method ZipIterables(@iterables) { nqp::if( - nqp::isgt_i((my int $n = @iterables.elems),0), # reifies + nqp::isgt_i(@iterables.elems,0), # reifies ZipIterables.new(@iterables), - Rakudo::Iterator.Empty, + Rakudo::Iterator.Empty ) }