Browse Source

Simplify code

Use a single append call instead of a ranged for loop.
pull/501/head
Christian Muehlhaeuser 7 years ago
parent
commit
712aebad6b
No known key found for this signature in database
GPG Key ID: 3CF9FA45CA1EBB7E
  1. 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.regexp.queries = append(c.regexp.queries, copyRouteRegexp(q))
} }
c.matchers = make([]matcher, 0, len(r.matchers)) c.matchers = make([]matcher, len(r.matchers))
for _, m := range r.matchers { copy(c.matchers, r.matchers)
c.matchers = append(c.matchers, m)
}
return c return c
} }

Loading…
Cancel
Save