3 ms·
On the other hand Ruby has the Schwartzian transform baked in :) foo.sort { |a,b| a.expensive <=> b.expensive } # basic foo.sort_by { |a,b| a.expens
by stouset 2y ago
On the other hand Ruby has the Schwartzian transform baked in :)
foo.sort { |a,b| a.expensive <=> b.expensive } # basic
foo.sort_by { |a,b| a.expensive <=> b.expensive } # Schwartz-enabled