all: replace loop with single append

Signed-off-by: Elena Morozova <lelenanam@gmail.com>
Upstream-commit: 64238fef8c7b739a2ae5648386cf594eb3a162e5
Component: engine
This commit is contained in:
Elena Morozova
2016-10-13 09:34:19 -07:00
parent 2bbf5bd013
commit 4b9781e130
11 changed files with 15 additions and 45 deletions

View File

@ -27,9 +27,7 @@ func (n *networkRouter) getNetworksList(ctx context.Context, w http.ResponseWrit
list := []types.NetworkResource{}
if nr, err := n.clusterProvider.GetNetworks(); err == nil {
for _, nw := range nr {
list = append(list, nw)
}
list = append(list, nr...)
}
// Combine the network list returned by Docker daemon if it is not already

View File

@ -146,9 +146,7 @@ func (s *Server) makeHTTPHandler(handler httputils.APIFunc) http.HandlerFunc {
// InitRouter initializes the list of routers for the server.
// This method also enables the Go profiler if enableProfiler is true.
func (s *Server) InitRouter(enableProfiler bool, routers ...router.Router) {
for _, r := range routers {
s.routers = append(s.routers, r)
}
s.routers = append(s.routers, routers...)
m := s.createMux()
if enableProfiler {