aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2014-03-28 10:55:56 -0700
committerXavier Noria <fxn@hashref.com>2014-03-28 10:55:56 -0700
commit86c53d510cf31b792a7e96a44535e64b3983d17a (patch)
treef8f8d19f5f40bf4b368523ba5525b1bd75182f90 /actionpack/lib/action_dispatch
parent74d7df175c83e73347114c004ff861aec0572928 (diff)
parente43cd0a4c9c1d33c7d1007a51ad885a579c0bfbc (diff)
downloadrails-86c53d510cf31b792a7e96a44535e64b3983d17a.tar.gz
rails-86c53d510cf31b792a7e96a44535e64b3983d17a.tar.bz2
rails-86c53d510cf31b792a7e96a44535e64b3983d17a.zip
Merge pull request #14521 from kreynolds/replace-regexp-with-include-or-string
Replace trivial regexp with string or include, twice as fast
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/mime_type.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb
index 3d2dd2d632..9450be838c 100644
--- a/actionpack/lib/action_dispatch/http/mime_type.rb
+++ b/actionpack/lib/action_dispatch/http/mime_type.rb
@@ -174,7 +174,7 @@ module Mime
end
def parse(accept_header)
- if accept_header !~ /,/
+ if !accept_header.include?(',')
accept_header = accept_header.split(PARAMETER_SEPARATOR_REGEXP).first
parse_trailing_star(accept_header) || [Mime::Type.lookup(accept_header)].compact
else