daemon/monitor: rm redundant if

The last check for err != nil is not needed as err is always non-nil
there. Remove the check.

Also, no need to explicitly define `var err error` here.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2019-08-05 16:56:38 -07:00 committed by Sebastiaan van Stijn
parent 6392e765ac
commit 3ef7f7c650
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -202,15 +202,13 @@ func (daemon *Daemon) autoRemove(c *container.Container) {
return return
} }
var err error err := daemon.ContainerRm(c.ID, &types.ContainerRmConfig{ForceRemove: true, RemoveVolume: true})
if err = daemon.ContainerRm(c.ID, &types.ContainerRmConfig{ForceRemove: true, RemoveVolume: true}); err == nil { if err == nil {
return return
} }
if c := daemon.containers.Get(c.ID); c == nil { if c := daemon.containers.Get(c.ID); c == nil {
return return
} }
if err != nil { logrus.WithError(err).WithField("container", c.ID).Error("error removing container")
logrus.WithError(err).WithField("container", c.ID).Error("error removing container")
}
} }