Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit eba8b70d4ec7239694b026bef3c07e5ad82efe69 1 parent 66dd216
@DNNX DNNX authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionpack/lib/action_dispatch/journey/formatter.rb
View
2  actionpack/lib/action_dispatch/journey/formatter.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.