Unverified Commit 03b434c9 authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #58122 from tianshapjq/nit-int-is-enough

Len() is already int
parents cdfb9126 e0f15bf5
...@@ -612,7 +612,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi ...@@ -612,7 +612,7 @@ func (m *ManagerImpl) devicesToAllocate(podUID, contName, resource string, requi
devicesInUse := m.allocatedDevices[resource] devicesInUse := m.allocatedDevices[resource]
// Gets a list of available devices. // Gets a list of available devices.
available := m.healthyDevices[resource].Difference(devicesInUse) available := m.healthyDevices[resource].Difference(devicesInUse)
if int(available.Len()) < needed { if available.Len() < needed {
return nil, fmt.Errorf("requested number of devices unavailable for %s. Requested: %d, Available: %d", resource, needed, available.Len()) return nil, fmt.Errorf("requested number of devices unavailable for %s. Requested: %d, Available: %d", resource, needed, available.Len())
} }
allocated := available.UnsortedList()[:needed] allocated := available.UnsortedList()[:needed]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment