Skip to content

Commit 89aa984

Browse files
committed
Merge pull request ant0ine#91 from josharian/fix-lock-copy
Don't copy regexp.Regexp during range
2 parents f253ff8 + e91d315 commit 89aa984

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rest/router_benchmark_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func BenchmarkRegExpLoop(b *testing.B) {
109109
if err != nil {
110110
panic(err)
111111
}
112-
routeRegexps := []regexp.Regexp{}
112+
routeRegexps := []*regexp.Regexp{}
113113
for _, route := range routes {
114114

115115
// generate the regexp string
@@ -123,7 +123,7 @@ func BenchmarkRegExpLoop(b *testing.B) {
123123
panic(err)
124124
}
125125

126-
routeRegexps = append(routeRegexps, *reg)
126+
routeRegexps = append(routeRegexps, reg)
127127
}
128128

129129
b.StartTimer()

0 commit comments

Comments
 (0)