Skip to content

Commit

Permalink
Simplify code (#501)
Browse files Browse the repository at this point in the history
Use a single append call instead of a ranged for loop.
  • Loading branch information
muesli authored and elithrar committed Jul 20, 2019
1 parent 50fbc3e commit eab9c4f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mux.go
Expand Up @@ -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
}
Expand Down

0 comments on commit eab9c4f

Please sign in to comment.