BagHash.pm6 (rakudo-2020.08.2) | : | BagHash.pm6 (rakudo-2020.09) | ||
---|---|---|---|---|
skipping to change at line 315 | skipping to change at line 315 | |||
), | ), | |||
IterationEnd | IterationEnd | |||
) | ) | |||
} ) | } ) | |||
), | ), | |||
Rakudo::Iterator.Empty | Rakudo::Iterator.Empty | |||
)) | )) | |||
} | } | |||
#--- convenience methods | #--- convenience methods | |||
method add(\to-add --> Nil) { | method add(BagHash:D: \to-add --> Nil) { | |||
nqp::bindattr( | nqp::bindattr( | |||
self,SetHash,'$!elems',nqp::create(Rakudo::Internals::IterationSet) | self,SetHash,'$!elems',nqp::create(Rakudo::Internals::IterationSet) | |||
) unless $!elems; | ) unless $!elems; | |||
Rakudo::QuantHash.ADD-ITERATOR-TO-BAG( | Rakudo::QuantHash.ADD-ITERATOR-TO-BAG( | |||
$!elems, to-add.iterator, self.keyof | $!elems, to-add.iterator, self.keyof | |||
); | ); | |||
} | } | |||
method remove(\to-remove --> Nil) { | method remove(BagHash:D: \to-remove --> Nil) { | |||
Rakudo::QuantHash.SUB-ITERATOR-FROM-BAG( | Rakudo::QuantHash.SUB-ITERATOR-FROM-BAG( | |||
$!elems, to-remove.iterator | $!elems, to-remove.iterator | |||
) if $!elems; | ) if $!elems; | |||
} | } | |||
} | } | |||
# vim: expandtab shiftwidth=4 | # vim: expandtab shiftwidth=4 | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |