From d04bcf94da9a19d9470f920587f8d2055d3b7108 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 1 Apr 2014 15:50:58 -0700 Subject: only ask if `t` is empty once. --- actionpack/lib/action_dispatch/journey/gtg/transition_table.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb b/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb index e6212b1ee2..53c47f4696 100644 --- a/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb +++ b/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb @@ -40,6 +40,7 @@ module ActionDispatch end def move(t, a) + return [] if t.empty? move_string(t, a).concat(move_regexp(t, a)) end @@ -141,8 +142,6 @@ module ActionDispatch end def move_regexp(t, a) - return [] if t.empty? - t.flat_map { |s| if states = @regexp_states[s] states.map { |re, v| re === a ? v : nil } @@ -151,8 +150,6 @@ module ActionDispatch end def move_string(t, a) - return [] if t.empty? - t.map do |s| if states = @string_states[s] states[a] -- cgit v1.2.3