Browse Source

Simplify code (#501)

Use a single append call instead of a ranged for loop.
pull/503/head
Christian Muehlhaeuser 7 years ago committed by Matt Silverlock
parent
commit
eab9c4f3d2
  1. 6
      mux.go

6
mux.go

@ -111,10 +111,8 @@ func copyRouteConf(r routeConf) routeConf { @@ -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
}

Loading…
Cancel
Save