Skip to content

Commit

Permalink
Fix problem in QuantHash.ACCEPTS
Browse files Browse the repository at this point in the history
If the invocant or the candidate where a xxxHash type with initially
some elements, but then all elements removed, would not accept a newly
created xxxHash object.
  • Loading branch information
lizmat committed Jul 31, 2018
1 parent f9963bb commit 712d0f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/Baggy.pm6
Expand Up @@ -20,9 +20,9 @@ my role Baggy does QuantHash {
nqp::unless(
nqp::eqaddr(self,other),
nqp::if( # not same object
(my $araw := $!elems),
(my $araw := $!elems) && nqp::elems($araw),
nqp::if( # something on left
(my $braw := other.RAW-HASH),
(my $braw := other.RAW-HASH) && nqp::elems($braw),
nqp::if( # something on both sides
nqp::iseq_i(nqp::elems($araw),nqp::elems($braw)),
nqp::stmts( # same size
Expand Down
4 changes: 2 additions & 2 deletions src/core/Setty.pm6
Expand Up @@ -109,9 +109,9 @@ my role Setty does QuantHash {
nqp::unless(
nqp::eqaddr(self,other),
nqp::if( # not same object
$!elems,
$!elems && nqp::elems($!elems),
nqp::if( # something on left
(my $oraw := other.RAW-HASH),
(my $oraw := other.RAW-HASH) && nqp::elems($oraw),
nqp::if( # something on both sides
nqp::iseq_i(nqp::elems($!elems),nqp::elems($oraw)),
nqp::stmts( # same size
Expand Down

0 comments on commit 712d0f0

Please sign in to comment.