Skip to content

Commit

Permalink
Shorten R:Q.MIX-IS-SUBSET a bit
Browse files Browse the repository at this point in the history
nqp::iterator also returns false on an empty nqp::hash
  • Loading branch information
lizmat committed Jul 11, 2017
1 parent 58900e7 commit 2eeb000
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/Rakudo/QuantHash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1428,11 +1428,10 @@ my class Rakudo::QuantHash {
nqp::eqaddr(nqp::decont($a),nqp::decont($b)),
True, # X is always a subset of itself
nqp::if(
(my $araw := $a.RAW-HASH) && nqp::elems($araw),
(my $araw := $a.RAW-HASH) && (my $iter := nqp::iterator($araw)),
nqp::if( # elems in A
(my $braw := $b.RAW-HASH) && nqp::elems($braw),
nqp::stmts( # elems in A and B
(my $iter := nqp::iterator($araw)),
nqp::while( # check all values in A with B
$iter,
nqp::unless(
Expand Down

0 comments on commit 2eeb000

Please sign in to comment.