Simplify code (#501)

Use a single append call instead of a ranged for loop.
This commit is contained in:
Christian Muehlhaeuser
2019-07-20 16:49:38 +02:00
committed by Matt Silverlock
parent 50fbc3e7fb
commit eab9c4f3d2

6
mux.go
View File

@@ -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
}