Skip to content

Commit

Permalink
Reorder if-statement
Browse files Browse the repository at this point in the history
  • Loading branch information
birksl committed Jun 7, 2024
1 parent 957e607 commit 5f39772
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/services/govmomi/pci/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ func createBackingInfo(spec infrav1.PCIDeviceSpec) types.BaseVirtualDeviceBackin
}

func constructKey(pciDeviceSpec infrav1.PCIDeviceSpec) string {
if pciDeviceSpec.DeviceID != nil && pciDeviceSpec.VendorID != nil {
return fmt.Sprintf("%d-%d", *pciDeviceSpec.DeviceID, *pciDeviceSpec.VendorID)
if pciDeviceSpec.VGPUProfile != "" {
return pciDeviceSpec.VGPUProfile
}

return pciDeviceSpec.VGPUProfile
return fmt.Sprintf("%d-%d", *pciDeviceSpec.DeviceID, *pciDeviceSpec.VendorID)
}

0 comments on commit 5f39772

Please sign in to comment.