Permalink
Browse files

Make .KeySet/.KeyBag always create a new object

  • Loading branch information...
1 parent a954307 commit afa2a5cb19a04aba39e7a9631823127f44ce08ab @lizmat lizmat committed Sep 10, 2013
Showing with 4 additions and 4 deletions.
  1. +1 −1 src/core/KeyBag.pm
  2. +1 −1 src/core/KeySet.pm
  3. +2 −2 src/core/Setty.pm
View
@@ -10,5 +10,5 @@ my class KeyBag does Baggy {
Bag.new-fp(nqp::getattr(self, KeyBag, '%!elems').values);
}
}
- method KeyBag (:$clone) { $clone ?? KeyBag.new-fp(self.pairs) !! self }
+ method KeyBag { KeyBag.new-fp(self.pairs) }
}
View
@@ -11,5 +11,5 @@ my class KeySet does Setty {
}
}
- method KeySet (:$clone) { $clone ?? KeySet.new(self.keys) !! self }
+ method KeySet { KeySet.new(self.keys) }
}
View
@@ -149,7 +149,7 @@ only sub infix:<(&)>(**@p) {
return set() unless @p;
if @p.grep(Baggy) {
- my $keybag = @p.shift.KeyBag(:clone);
+ my $keybag = @p.shift.KeyBag;
for @p.map(*.Bag(:view)) -> $bag {
$bag{$_}
?? $keybag{$_} min= $bag{$_}
@@ -159,7 +159,7 @@ only sub infix:<(&)>(**@p) {
$keybag.Bag(:view);
}
else {
- my $keyset = @p.shift.KeySet(:clone);
+ my $keyset = @p.shift.KeySet;
for @p.map(*.Set(:view)) -> $set {
$set{$_} || $keyset.delete($_) for $keyset.keys;
}

0 comments on commit afa2a5c

Please sign in to comment.