aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey/gtg
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-01 15:58:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-01 15:58:42 -0700
commit6c6dc329f8ca87304bce3be79f4d1172219d07ad (patch)
tree39a372f92f7074da0cd86eab28435e3b62f04881 /actionpack/lib/action_dispatch/journey/gtg
parent0e53d11b1fa9712270402afce771402c45fdd645 (diff)
downloadrails-6c6dc329f8ca87304bce3be79f4d1172219d07ad.tar.gz
rails-6c6dc329f8ca87304bce3be79f4d1172219d07ad.tar.bz2
rails-6c6dc329f8ca87304bce3be79f4d1172219d07ad.zip
push move_string in to `move`
Diffstat (limited to 'actionpack/lib/action_dispatch/journey/gtg')
-rw-r--r--actionpack/lib/action_dispatch/journey/gtg/transition_table.rb26
1 files changed, 12 insertions, 14 deletions
diff --git a/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb b/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb
index 821b510b9e..990d2127ee 100644
--- a/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb
+++ b/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb
@@ -41,7 +41,18 @@ module ActionDispatch
def move(t, a)
return [] if t.empty?
- move_string(t, a)
+
+ regexps = []
+
+ t.map { |s|
+ if states = @regexp_states[s]
+ regexps.concat states.map { |re, v| re === a ? v : nil }
+ end
+
+ if states = @string_states[s]
+ states[a]
+ end
+ }.compact.concat regexps
end
def as_json(options = nil)
@@ -140,19 +151,6 @@ module ActionDispatch
raise ArgumentError, 'unknown symbol: %s' % sym.class
end
end
-
- def move_string(t, a)
- regexps = []
- t.map { |s|
- if states = @regexp_states[s]
- regexps.concat states.map { |re, v| re === a ? v : nil }
- end
-
- if states = @string_states[s]
- states[a]
- end
- }.compact.concat regexps
- end
end
end
end