Skip to content

Commit 0afcb0b

Browse files
committed
Improve from O(n^2) to O(n)
1 parent c87f768 commit 0afcb0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/addressable/template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ def parse_new_template_pattern(pattern, processor = nil)
10141014
end
10151015
if modifier == '*'
10161016
seg = case operator
1017-
when '+', '#' then "#{RESERVED_NO_COMMA}*?"
1017+
when '+', '#' then "#{RESERVED_NO_COMMA}*+"
10181018
else group
10191019
end
10201020
"(?<#{name}>#{seg}(?:#{joiner}?#{seg})*)?"

0 commit comments

Comments
 (0)