提交 511d1abc 编写于 作者: A Akira Matsuda

Reduce method invocations and object allocations in head()

上级 34a7e68b
......@@ -29,7 +29,7 @@ def head(status, options = {})
content_type = options.delete(:content_type)
options.each do |key, value|
headers[key.to_s.dasherize.split("-").each { |v| v[0] = v[0].chr.upcase }.join("-")] = value.to_s
headers[key.to_s.split(/[-_]/).each { |v| v[0] = v[0].upcase }.join("-")] = value.to_s
end
self.status = status
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册