Simplify code (#501)
Use a single append call instead of a ranged for loop.
This commit is contained in:
committed by
Matt Silverlock
parent
50fbc3e7fb
commit
eab9c4f3d2
6
mux.go
6
mux.go
@@ -111,10 +111,8 @@ func copyRouteConf(r routeConf) routeConf {
|
||||
c.regexp.queries = append(c.regexp.queries, copyRouteRegexp(q))
|
||||
}
|
||||
|
||||
c.matchers = make([]matcher, 0, len(r.matchers))
|
||||
for _, m := range r.matchers {
|
||||
c.matchers = append(c.matchers, m)
|
||||
}
|
||||
c.matchers = make([]matcher, len(r.matchers))
|
||||
copy(c.matchers, r.matchers)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user