From f602c02cebd871d04f6c183b6fb3f70bc4ed50ed Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Fri, 3 Jan 2020 23:39:39 +0100 Subject: [PATCH] Don't handle 1-element lists differently with roundrobin Fixes #3402 xingminglai++ for spotting, jnthn++ for the fix --- src/core.c/Rakudo/Iterator.pm6 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core.c/Rakudo/Iterator.pm6 b/src/core.c/Rakudo/Iterator.pm6 index e5912927682..f8bdd50f6cd 100644 --- a/src/core.c/Rakudo/Iterator.pm6 +++ b/src/core.c/Rakudo/Iterator.pm6 @@ -3257,13 +3257,9 @@ class Rakudo::Iterator { } method RoundrobinIterables(@iterables) { nqp::if( - nqp::isgt_i((my int $n = @iterables.elems),1), # reifies + nqp::isgt_i(@iterables.elems,0), # reifies RoundrobinIterables.new(@iterables), - nqp::if( - nqp::iseq_i($n,0), - Rakudo::Iterator.Empty, - nqp::atpos(nqp::getattr(@iterables,List,'$!reified'),0).iterator - ) + Rakudo::Iterator.Empty, ) }