aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorViktar Basharymau <viktar.basharymau@thehamon.com>2014-06-20 17:16:11 +0300
committerViktar Basharymau <viktar.basharymau@thehamon.com>2014-06-20 17:16:11 +0300
commit8ee785a17fa0dab88762c2866507bb33760c9f7a (patch)
treebe28b2eb9aff2461da0b1158d0dbce09ffb2f1c2 /activerecord/lib/active_record
parentedc0f271978585635153068c708d62f5243dafe0 (diff)
downloadrails-8ee785a17fa0dab88762c2866507bb33760c9f7a.tar.gz
rails-8ee785a17fa0dab88762c2866507bb33760c9f7a.tar.bz2
rails-8ee785a17fa0dab88762c2866507bb33760c9f7a.zip
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.
Diffstat (limited to 'activerecord/lib/active_record')
0 files changed, 0 insertions, 0 deletions