Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make sure Baggy.grab cleans up after itself
  • Loading branch information
lizmat committed Oct 6, 2013
1 parent c6b15dc commit 08d0f14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Baggy.pm
Expand Up @@ -75,7 +75,9 @@ my role Baggy does QuantHash {
method pairs() { %!elems.values }

method grab ($count = 1) {
ROLLPICKGRAB(self, $count, %!elems.values);
my @grab = ROLLPICKGRAB(self, $count, %!elems.values);
%!elems{ @grab.map({.WHICH}).grep: { %!elems{$_}.value == 0 } }:delete;
@grab;
}
method pick ($count = 1) {
ROLLPICKGRAB(self, $count, %!elems.values.map: { (.key => .value) });
Expand Down

0 comments on commit 08d0f14

Please sign in to comment.