Browse code

libnet: Controller: drop closeStores

Previous commit made it clear that c.store can't be nil. Hence,
`c.store.Close()` can be called without checking if c.store is nil.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>

Albin Kerouanton authored on 2024/05/10 18:59:36
Showing 2 changed files
... ...
@@ -1089,7 +1089,7 @@ func (c *Controller) getIPAMDriver(name string) (ipamapi.Ipam, *ipamapi.Capabili
1089 1089
 
1090 1090
 // Stop stops the network controller.
1091 1091
 func (c *Controller) Stop() {
1092
-	c.closeStores()
1092
+	c.store.Close()
1093 1093
 	c.stopExternalKeyListener()
1094 1094
 	osl.GC()
1095 1095
 }
... ...
@@ -10,12 +10,6 @@ import (
10 10
 	"github.com/docker/docker/libnetwork/scope"
11 11
 )
12 12
 
13
-func (c *Controller) closeStores() {
14
-	if store := c.store; store != nil {
15
-		store.Close()
16
-	}
17
-}
18
-
19 13
 func (c *Controller) getStore() *datastore.Store {
20 14
 	return c.store
21 15
 }