提交 eba8b70d 编写于 作者: V Viktar Basharymau

Use `break` instead of `next` in AD::Journey::Formatter#match_route

The array is sorted in descending order, so there is no point in
iterating further if we met a negative item - all the rest will be
negative too.
上级 66dd2167
......@@ -85,7 +85,7 @@ def match_route(name, options)
hash = routes.group_by { |_, r| r.score(options) }
hash.keys.sort.reverse_each do |score|
next if score < 0
break if score < 0
hash[score].sort_by { |i, _| i }.each do |_, route|
yield route
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册