diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-13 15:03:20 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-13 15:03:20 -0700 |
commit | 36f26fd47ecff07f229264560a68fca0d59911ca (patch) | |
tree | 0edaae8b67e7128bbf30c49c659e8ea78d49bb35 /actionpack | |
parent | b3d73e789cc8616fad30621e96f872bfd86ee099 (diff) | |
download | rails-36f26fd47ecff07f229264560a68fca0d59911ca.tar.gz rails-36f26fd47ecff07f229264560a68fca0d59911ca.tar.bz2 rails-36f26fd47ecff07f229264560a68fca0d59911ca.zip |
we already have access to the AST, so just use it
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 35f1653a49..b72031633b 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -546,16 +546,16 @@ module ActionDispatch pattern = Journey::Path::Pattern.new(strexp) - builder = Journey::GTG::Builder.new pattern.spec + builder = Journey::GTG::Builder.new ast # Get all the symbol nodes followed by literals that are not the # dummy node. - symbols = pattern.spec.grep(Journey::Nodes::Symbol).find_all { |n| + symbols = ast.grep(Journey::Nodes::Symbol).find_all { |n| builder.followpos(n).first.literal? } # Get all the symbol nodes preceded by literals. - symbols.concat pattern.spec.find_all(&:literal?).map { |n| + symbols.concat ast.find_all(&:literal?).map { |n| builder.followpos(n).first }.find_all(&:symbol?) |