move m.GetPaths out of the loop
only call m.GetPaths once is ok. os move it out of the loop. Signed-off-by: Wang Long <long.wanglong@huawei.com>
This commit is contained in:
parent
710a660506
commit
fd92846686
|
@ -195,8 +195,9 @@ func (m *Manager) Set(container *configs.Config) error {
|
|||
if m.Cgroups.Paths != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
paths := m.GetPaths()
|
||||
for _, sys := range subsystems {
|
||||
paths := m.GetPaths()
|
||||
path := paths[sys.Name()]
|
||||
if err := sys.Set(path, container.Cgroups); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue