File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 44
55* Your contribution here.
66* [ #1944 ] ( https://github.com/ruby-grape/grape/pull/1944 ) : Reduced attribute_translator string allocations - [ @ericproulx ] ( https://github.com/ericproulx ) .
7+ * [ #1943 ] ( https://github.com/ruby-grape/grape/pull/1943 ) : Reduce number of regex string allocations - [ @ericproulx ] ( https://github.com/ericproulx ) .
78* [ #1942 ] ( https://github.com/ruby-grape/grape/pull/1942 ) : Optimized retained memory methods - [ @ericproulx ] ( https://github.com/ericproulx ) .
89* [ #1941 ] ( https://github.com/ruby-grape/grape/pull/1941 ) : Frozen string literal - [ @ericproulx ] ( https://github.com/ericproulx ) .
910* [ #1940 ] ( https://github.com/ruby-grape/grape/pull/1940 ) : Get rid of a needless step in HashWithIndifferentAccess - [ @dnesteryuk ] ( https://github.com/dnesteryuk ) .
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def compile!
4141 routes = map [ method ]
4242 @optimized_map [ method ] = routes . map . with_index do |route , index |
4343 route . index = index
44- route . regexp = /( ?<_#{ index } >#{ route . pattern . to_regexp } )/
44+ route . regexp = Regexp . new ( "( ?<_#{ index } >#{ route . pattern . to_regexp } )" )
4545 end
4646 @optimized_map [ method ] = Regexp . union ( @optimized_map [ method ] )
4747 end
@@ -53,7 +53,7 @@ def append(route)
5353 end
5454
5555 def associate_routes ( pattern , **options )
56- regexp = /( ?<_#{ @neutral_map . length } >)#{ pattern . to_regexp } /
56+ regexp = Regexp . new ( "( ?<_#{ @neutral_map . length } >)#{ pattern . to_regexp } " )
5757 @neutral_map << Any . new ( pattern , regexp , @neutral_map . length , **options )
5858 end
5959
You can’t perform that action at this time.
0 commit comments