Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
attempt to de-flatten sort
  • Loading branch information
TimToady committed Sep 19, 2015
1 parent ffa8ea2 commit 8c3980f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/Any-iterable-methods.pm
Expand Up @@ -769,10 +769,10 @@ proto sub squish(|) { * }
multi sub squish(+values, |c) { values.squish(|c) }

proto sub sort(|) {*}
multi sub sort(*@values) {
nqp::istype(@values.AT-POS(0), Callable)
?? SEQ(my $cmp := @values.shift; @values.sort($cmp) )
!! @values.sort;
multi sub sort($cmp, +values) {
nqp::istype($cmp, Callable)
?? values.sort($cmp)
!! (|$cmp,|values).sort;
}

# vim: ft=perl6 expandtab sw=4

0 comments on commit 8c3980f

Please sign in to comment.