Skip to content

Commit

Permalink
Make sure X handles empty lists on RHS
Browse files Browse the repository at this point in the history
Fixes R#2286
  • Loading branch information
lizmat committed Sep 17, 2018
1 parent 0a45ffb commit 6c93fde
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/Rakudo/Iterator.pm6
Expand Up @@ -1133,18 +1133,18 @@ class Rakudo::Iterator {


# it's a List, may have a reified we can use directly # it's a List, may have a reified we can use directly
nqp::if( nqp::if(
nqp::isnull( nqp::isconcrete(
$elem := nqp::getattr($elem,List,'$!reified') $elem := nqp::getattr($elem,List,'$!reified')
) || nqp::iseq_i(nqp::elems($elem),0), ) && nqp::isgt_i(nqp::elems($elem),0),

# cross with an empty list is always an empty list
(return Rakudo::Iterator.Empty),


# use the available reified directly # use the available reified directly
nqp::stmts( nqp::stmts(
nqp::bindpos($!reifieds,$i,$elem), nqp::bindpos($!reifieds,$i,$elem),
nqp::atpos($elem,0) nqp::atpos($elem,0)
) ),

# cross with an empty list is always an empty list
(return Rakudo::Iterator.Empty)
), ),


# need to set up an iterator # need to set up an iterator
Expand Down

0 comments on commit 6c93fde

Please sign in to comment.