Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't mutate the options hash, so we don't have to dup

avoids extra hash allocations on each call
  • Loading branch information...
commit 73a7b52f0182a789bf45d4b0c23384911d1ed034 1 parent 727ae97
@tenderlove tenderlove authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 actionpack/lib/action_dispatch/http/url.rb
View
7 actionpack/lib/action_dispatch/http/url.rb
@@ -29,10 +29,9 @@ def extract_subdomain(host, tld_length = @@tld_length)
extract_subdomains(host, tld_length).join('.')
end
- def url_for(options = {})
- options = options.dup
- path = options.delete(:script_name).to_s.chomp("/")
- path << options.delete(:path).to_s
+ def url_for(options)
+ path = options[:script_name].to_s.chomp("/")
+ path << options[:path].to_s
params = options[:params].is_a?(Hash) ? options[:params] : options.slice(:params)
params.reject! { |_,v| v.to_param.nil? }
Please sign in to comment.
Something went wrong with that request. Please try again.