Skip to content

Commit

Permalink
Clean up sub sort as per sorear++.
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Jan 3, 2012
1 parent ec38c2f commit e27d9b7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/CORE.setting
Original file line number Diff line number Diff line change
Expand Up @@ -1514,15 +1514,11 @@ sub values(%h) { %h.values }
sub kv($p) { $p.kv }
sub sort(*@values) {
if @values {
if @values[0] ~~ Callable {
my $cmp = @values.shift;
@values.sort($cmp);
} else {
@values.sort;
}
if @values && @values[0] ~~ Callable {
my $cmp = @values.shift;
@values.sort($cmp);
} else {
@values;
@values.sort;
}
}
Expand Down

0 comments on commit e27d9b7

Please sign in to comment.