Project

General

Profile

Actions

Feature #8422

closed

add Enumerable#reverse_sort and Enumerable#reverse_sort_by

Added by Hanmac (Hans Mackowiak) over 11 years ago. Updated over 11 years ago.

Status:
Feedback
Assignee:
-
Target version:
-
[ruby-core:55046]

Description

they are better when you want descending order,
enum.sort.reverse
does work too, but it is to slow because it needs to build that result array twice

they both can be defined just like #sort and #sort_by but negates the result of the compare block

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0