Skip to content

Commit

Permalink
Don't handle 1-element lists differently with roundrobin
Browse files Browse the repository at this point in the history
Fixes #3402  xingminglai++ for spotting, jnthn++ for the fix
  • Loading branch information
lizmat committed Jan 3, 2020
1 parent e5627b8 commit f602c02
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/core.c/Rakudo/Iterator.pm6
Expand Up @@ -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,
)
}

Expand Down

0 comments on commit f602c02

Please sign in to comment.