Project

General

Profile

Actions

Feature #8422

open

add Enumerable#reverse_sort and Enumerable#reverse_sort_by

Added by Hanmac (Hans Mackowiak) about 8 years ago. Updated about 8 years ago.

Status:
Feedback
Priority:
Normal
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