Skip to content

Commit

Permalink
pci: align to the left the loop
Browse files Browse the repository at this point in the history
simplify the code without change in behaviour, using
a flow without `else` to reduce the blocks.

Signed-off-by: Francesco Romani <fromani@redhat.com>
  • Loading branch information
ffromani committed May 4, 2022
1 parent 2ea05cb commit c83d6fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/pci/pci_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ func (info *Info) ListDevices() []*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
}

0 comments on commit c83d6fc

Please sign in to comment.