Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Burdening all Set/Bag objects with .total calculation, doesn't make s…
…ense
  • Loading branch information
lizmat committed Oct 4, 2013
1 parent c962e51 commit 9f6f443
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/core/Bag.pm
@@ -1,12 +1,9 @@
my class Bag does Baggy {
has Int $!total;
has $!WHICH;

submethod total { $!total }
submethod WHICH { $!WHICH }
submethod BUILD (:%elems) {
my @keys := %elems.keys.sort;
$!total := [+] %elems.values.map: {.value};
$!WHICH := self.^name
~ '|'
~ @keys.map( { $_ ~ '(' ~ %elems{$_}.value ~ ')' } );
Expand Down
3 changes: 0 additions & 3 deletions src/core/Set.pm
@@ -1,12 +1,9 @@
my class Set does Setty {
has Int $!total;
has $!WHICH;

submethod total { $!total }
submethod WHICH { $!WHICH }
submethod BUILD (:%elems) {
my @keys := %elems.keys.sort;
$!total := %elems.elems;
$!WHICH := self.^name ~ '|' ~ @keys.sort;
nqp::bindattr(self, Set, '%!elems', %elems);
}
Expand Down

0 comments on commit 9f6f443

Please sign in to comment.