aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-01 15:50:58 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-01 15:50:58 -0700
commitd04bcf94da9a19d9470f920587f8d2055d3b7108 (patch)
tree70317ef2de649c18fa3e258e0eafc40998c83200 /actionpack
parent165d93b22ff5f8798296bd5d7642d0ddb8996c74 (diff)
downloadrails-d04bcf94da9a19d9470f920587f8d2055d3b7108.tar.gz
rails-d04bcf94da9a19d9470f920587f8d2055d3b7108.tar.bz2
rails-d04bcf94da9a19d9470f920587f8d2055d3b7108.zip
only ask if `t` is empty once.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/journey/gtg/transition_table.rb5
1 files changed, 1 insertions, 4 deletions
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]