提交 b754d9b5 编写于 作者: A Aaron Patterson

drop hash allocations during match

上级 6bd9ade0
......@@ -136,11 +136,11 @@ def find_routes env
routes.map! { |r|
match_data = r.path.match(req.path_info)
path_parameters = {}
path_parameters = r.defaults.dup
match_data.names.zip(match_data.captures) { |name,val|
path_parameters[name.to_sym] = Utils.unescape_uri(val) if val
}
[match_data, r.defaults.merge(path_parameters), r]
[match_data, path_parameters, r]
}
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册