push move_string in to `move`
This commit is contained in:
parent
0e53d11b1f
commit
6c6dc329f8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue