Skip to content

Commit

Permalink
Use .find here as it is simpler and faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Sep 30, 2010
1 parent 31752f3 commit 69f97f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/routing/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ def name_for_action(as, action)
end

candidate = name.select(&:present?).join("_").presence
candidate unless as.nil? && @set.routes.map(&:name).include?(candidate)
candidate unless as.nil? && @set.routes.find { |r| r.name == candidate }
end
end

Expand Down

0 comments on commit 69f97f4

Please sign in to comment.