Skip to content

Commit 9b6f7d7

Browse files
authored
Merge pull request #39725 from vinistock/save_allocation_in_visit_star
Save a string allocation in visit_STAR
2 parents 17d0615 + 79fcdab commit 9b6f7d7

File tree

1 file changed

+2
-2
lines changed
  • actionpack/lib/action_dispatch/journey/path

1 file changed

+2
-2
lines changed

actionpack/lib/action_dispatch/journey/path/pattern.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def visit_SLASH(node)
107107
end
108108

109109
def visit_STAR(node)
110-
re = @matchers[node.left.to_sym] || ".+"
111-
"(#{re})"
110+
re = @matchers[node.left.to_sym]
111+
re ? "(#{re})" : "(.+)"
112112
end
113113

114114
def visit_OR(node)

0 commit comments

Comments
 (0)