Skip to content

Commit

Permalink
Add a number of missing deconts
Browse files Browse the repository at this point in the history
Fix for R#2167
  • Loading branch information
lizmat committed Aug 8, 2018
1 parent 74ea72e commit fa73bb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
18 changes: 12 additions & 6 deletions src/core/Rakudo/QuantHash.pm6
Expand Up @@ -317,15 +317,18 @@ my class Rakudo::QuantHash {
method ADD-PAIRS-TO-SET(\elems,Mu \iterator) {
nqp::stmts(
nqp::until(
nqp::eqaddr((my $pulled := iterator.pull-one),IterationEnd),
nqp::eqaddr(
(my $pulled := nqp::decont(iterator.pull-one)),
IterationEnd
),
nqp::if(
nqp::istype($pulled,Pair),
nqp::if(
nqp::getattr(nqp::decont($pulled),Pair,'$!value'),
nqp::getattr($pulled,Pair,'$!value'),
nqp::bindkey(
elems,
nqp::getattr(nqp::decont($pulled),Pair,'$!key').WHICH,
nqp::getattr(nqp::decont($pulled),Pair,'$!key')
nqp::getattr($pulled,Pair,'$!key').WHICH,
nqp::getattr($pulled,Pair,'$!key')
)
),
nqp::bindkey(elems,$pulled.WHICH,$pulled)
Expand Down Expand Up @@ -432,7 +435,7 @@ my class Rakudo::QuantHash {
(my $elems := nqp::clone(elems)),
nqp::until(
nqp::eqaddr( # end of iterator?
(my $pulled := iterator.pull-one),
(my $pulled := nqp::decont(iterator.pull-one)),
IterationEnd
) || nqp::not_i(nqp::elems($elems)), # nothing left to remove?
nqp::if(
Expand Down Expand Up @@ -579,7 +582,10 @@ my class Rakudo::QuantHash {
method ADD-ITERATOR-TO-BAG(\elems,Mu \iterator) {
nqp::stmts(
nqp::until(
nqp::eqaddr((my $pulled := iterator.pull-one),IterationEnd),
nqp::eqaddr(
(my $pulled := nqp::decont(iterator.pull-one)),
IterationEnd
),
nqp::if(
nqp::existskey(elems,(my $WHICH := $pulled.WHICH)),
nqp::stmts(
Expand Down
5 changes: 4 additions & 1 deletion src/core/set_elem.pm6
Expand Up @@ -54,7 +54,10 @@ multi sub infix:<(elem)>(Any $a, Iterator:D $b --> Bool:D) {
nqp::stmts(
(my str $needle = $a.WHICH),
nqp::until(
nqp::eqaddr((my $pulled := $b.pull-one),IterationEnd),
nqp::eqaddr(
(my $pulled := nqp::decont($b.pull-one)),
IterationEnd
),
nqp::if(
nqp::iseq_s($needle,$pulled.WHICH),
return True
Expand Down

0 comments on commit fa73bb4

Please sign in to comment.