Skip to content

Commit

Permalink
Fix Enumerable#sort_by
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Oct 29, 2013
1 parent 19898aa commit 2fd8fa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion corelib/enumerable.rb
Expand Up @@ -858,7 +858,7 @@ def sort_by(&block)
arg = Opal.destructure(`arguments`)

[block.call(arg), arg]
}.sort.map { |arg| `arg[1]` }
}.sort { |a, b| a[0] <=> b[0] }.map { |arg| `arg[1]` }
end

alias select find_all
Expand Down

0 comments on commit 2fd8fa0

Please sign in to comment.