rails/rails — pull request #15836 by DNNX (2014-06-20 15:29:33+00:00)
Title: Replace x.sort_by!.select! with x.select!.sort_by!

The latter has the same speed as the former in the worst case
and faster in general, because it is always better to sort less items.

Unfortunately, `routes.select!{...}.sort_by!{...}` is not possible here
because `select!` returns `nil`, so select! and sort! must be done
in two steps.