提交 bea24d47 编写于 作者: A Akira Matsuda

Reduce Array and Hash creations in Journey find_routes

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