mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Allow the map.Values() function in the CPUManager to take a set of keys
Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
parent
a160d9a8cd
commit
cfacc22459
@ -52,10 +52,13 @@ func (m mapIntInt) Keys() []int {
|
|||||||
return keys
|
return keys
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m mapIntInt) Values() []int {
|
func (m mapIntInt) Values(keys ...int) []int {
|
||||||
|
if keys == nil {
|
||||||
|
keys = m.Keys()
|
||||||
|
}
|
||||||
var values []int
|
var values []int
|
||||||
for _, v := range m {
|
for _, k := range keys {
|
||||||
values = append(values, v)
|
values = append(values, m[k])
|
||||||
}
|
}
|
||||||
return values
|
return values
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user