Skip to content

Commit

Permalink
Simplify code
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 committed Jul 20, 2019
1 parent d83b6ff commit 712aeba
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 712aeba

Please sign in to comment.