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:
Kevin Klues 2021-11-23 20:31:04 +00:00
parent a160d9a8cd
commit cfacc22459

View File

@ -52,10 +52,13 @@ func (m mapIntInt) Keys() []int {
return keys
}
func (m mapIntInt) Values() []int {
func (m mapIntInt) Values(keys ...int) []int {
if keys == nil {
keys = m.Keys()
}
var values []int
for _, v := range m {
values = append(values, v)
for _, k := range keys {
values = append(values, m[k])
}
return values
}