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:
Wang Long 2016-09-13 12:19:48 +00:00
parent 710a660506
commit fd92846686
1 changed files with 2 additions and 1 deletions

View File

@ -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