getAllNetworks unnecessary walks all the networks

- libnetwork controller Networks() already returns
  a copy list. Also Networks() correctly skips any
  network which ahs already been marked for deletion
  while getNetworks implementation bypass this.

Signed-off-by: Alessandro Boch <aboch@docker.com>
Upstream-commit: 5d71cc01b6bb089a70fa1e855943dab0d88439bb
Component: engine
This commit is contained in:
Alessandro Boch
2017-02-06 16:37:51 -08:00
parent c16190c838
commit 1a76374f64
+1 -9
View File
@@ -96,15 +96,7 @@ func (daemon *Daemon) GetNetworksByID(partialID string) []libnetwork.Network {
// getAllNetworks returns a list containing all networks
func (daemon *Daemon) getAllNetworks() []libnetwork.Network {
c := daemon.netController
list := []libnetwork.Network{}
l := func(nw libnetwork.Network) bool {
list = append(list, nw)
return false
}
c.WalkNetworks(l)
return list
return daemon.netController.Networks()
}
func isIngressNetwork(name string) bool {