Skip to content

Commit

Permalink
Reduction spree in set_intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 9, 2018
1 parent 9b5dec9 commit a2933ac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/core/set_intersection.pm6
Expand Up @@ -88,20 +88,20 @@ multi sub infix:<(&)>(Map:D $a, Map:D $b) {
nqp::eqaddr($a.keyof,Str(Any)) && nqp::eqaddr($b.keyof,Str(Any)),
nqp::if( # both ordinary Str hashes
nqp::elems(
my $araw := nqp::getattr(nqp::decont($a),Map,'$!storage')
my \araw := nqp::getattr(nqp::decont($a),Map,'$!storage')
) && nqp::elems(
my $braw := nqp::getattr(nqp::decont($b),Map,'$!storage')
my \braw := nqp::getattr(nqp::decont($b),Map,'$!storage')
),
nqp::stmts( # both are initialized
nqp::if(
nqp::islt_i(nqp::elems($araw),nqp::elems($braw)),
nqp::islt_i(nqp::elems(araw),nqp::elems(braw)),
nqp::stmts( # $a smallest, iterate over it
(my $iter := nqp::iterator($araw)),
(my $base := $braw)
(my $iter := nqp::iterator(araw)),
(my $base := braw)
),
nqp::stmts( # $b smallest, iterate over that
($iter := nqp::iterator($braw)),
($base := $araw)
($iter := nqp::iterator(braw)),
($base := araw)
)
),
(my $elems := nqp::create(Rakudo::Internals::IterationSet)),
Expand Down

0 comments on commit a2933ac

Please sign in to comment.