Permalink
Browse files

use destructive sort on array in Hash#to_param for performance gains.

  • Loading branch information...
1 parent 9a4268d commit 41fbfb40d89e76af8e47093237039a9887541612 @vipulnsward vipulnsward committed May 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 41fbfb4

Please sign in to comment.