From 6c6dc329f8ca87304bce3be79f4d1172219d07ad Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 1 Apr 2014 15:58:42 -0700 Subject: push move_string in to `move` --- .../journey/gtg/transition_table.rb | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'actionpack/lib/action_dispatch/journey/gtg') 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 -- cgit v1.2.3