Skip to content
Browse files

remove select, collect and then inject with

something better

Signed-off-by: José Valim <>
  • Loading branch information...
1 parent c5bfc6a commit 794b34306eea0c7e1e99f5741df16129e8e22b3f @neerajdotname neerajdotname committed with josevalim
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/http/mime_type.rb
2 actionpack/lib/action_dispatch/http/mime_type.rb
@@ -175,7 +175,7 @@ def parse(accept_header)
# returend value: [Mime::HTML, Mime::JS, Mime::XML, Mime::YAML, Mime::ATOM, Mime::JSON, Mime::RSS, Mime::URL_ENCODED_FORM
def parse_data_with_trailing_star(input)
keys ={|k| k.include?(input)}
- {|k,_| keys.include?(k)}.collect{|i| i[1]}.inject([]){|all,e| all.include?(e) ? all : all << e}
+ Mime::LOOKUP.values_at(*keys).uniq

0 comments on commit 794b343

Please sign in to comment.
Something went wrong with that request. Please try again.