Permalink
Browse files

simplfy List.classify, make it return a Hash as per spec

  • Loading branch information...
1 parent f23a454 commit 7d101ef2d7a88d14edbd7134fb2bf207faca69a4 @moritz moritz committed Jul 28, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 src/core/List.pm
View
@@ -277,11 +277,9 @@ my class List does Positional {
method classify(&test) {
my %result;
for @.list {
- my $k = test $_;
- %result{$k} //= [];
- %result{$k}.push: $_;
+ %result{test $_}.push: $_;
}
- %result.pairs;
+ %result
}
method categorize(&test) {

0 comments on commit 7d101ef

Please sign in to comment.