diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2013-05-05 14:48:34 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2013-05-05 14:48:34 -0700 |
commit | b5e4eb24e0fdef4eed37e67b9726ea0b595917da (patch) | |
tree | e163aad58f1314d78c935f8240f5d6956d1a89e7 /activesupport/lib | |
parent | 37f20ab9909ef8e252efdf2083cd930c756d161d (diff) | |
parent | 41fbfb40d89e76af8e47093237039a9887541612 (diff) | |
download | rails-b5e4eb24e0fdef4eed37e67b9726ea0b595917da.tar.gz rails-b5e4eb24e0fdef4eed37e67b9726ea0b595917da.tar.bz2 rails-b5e4eb24e0fdef4eed37e67b9726ea0b595917da.zip |
Merge pull request #10453 from vipulnsward/destructive_sort
Speed up Hash#to_param by switching from #sort to #sort!
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/to_param.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/to_param.rb b/activesupport/lib/active_support/core_ext/object/to_param.rb index 0d5f3501e5..3b137ce6ae 100644 --- a/activesupport/lib/active_support/core_ext/object/to_param.rb +++ b/activesupport/lib/active_support/core_ext/object/to_param.rb @@ -53,6 +53,6 @@ class Hash def to_param(namespace = nil) collect do |key, value| value.to_query(namespace ? "#{namespace}[#{key}]" : key) - end.sort * '&' + end.sort! * '&' end end |