提交 794b3430 编写于 作者: N Neeraj Singh 提交者: José Valim

remove select, collect and then inject with

something better
Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 c5bfc6ab
......@@ -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 = Mime::LOOKUP.keys.select{|k| k.include?(input)}
Mime::LOOKUP.select {|k,_| keys.include?(k)}.collect{|i| i[1]}.inject([]){|all,e| all.include?(e) ? all : all << e}
Mime::LOOKUP.values_at(*keys).uniq
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册