From ef7a5e024a37d58bcf0b84f478ba3ff40b9e86ab Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Sat, 30 Apr 2022 15:48:11 +0200 Subject: [PATCH] pci: align to the left the loop simplify the code without change in behaviour, using a flow without `else` to reduce the blocks. Signed-off-by: Francesco Romani --- pkg/pci/pci_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/pci/pci_linux.go b/pkg/pci/pci_linux.go index 7db42364..3c133ee9 100644 --- a/pkg/pci/pci_linux.go +++ b/pkg/pci/pci_linux.go @@ -405,9 +405,9 @@ func (info *Info) getDevices() []*Device { dev = info.GetDevice(addr) if dev == nil { info.ctx.Warn("failed to get device information for PCI address %s", addr) - } else { - devs = append(devs, dev) + continue } + devs = append(devs, dev) } return devs }