Skip to content

Commit

Permalink
sort by comparable
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Feb 5, 2013
1 parent 24ef17d commit ab1b921
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ruby/ycp/builtins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,10 @@ def self.setcontains list, value

# sort() YCP built-in
# Sorts a List according to the YCP builtin predicate
# TODO FIXME: Sort list using an expression
def self.sort array
return nil if array.nil?

array.sort
array.sort {|x,y| YCP::Ops.comparable_object(x) <=> y }
end

# splitstring() YCP built-in
Expand Down

0 comments on commit ab1b921

Please sign in to comment.