libct/cg/sd/v1: initPaths: minor optimization

As ExpandSlice("system.slice") returns "/system.slice", there is no need
to call it for such paths (and the slash will be added by path.Join
anyway).

The same optimization was already done for v2 as part of commit
bf15cc99b1.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2021-08-05 18:08:01 -07:00
parent 63c84917f3
commit eb09df749a
+5 -6
View File
@@ -109,14 +109,13 @@ func (m *legacyManager) initPaths() error {
slice := "system.slice"
if c.Parent != "" {
slice = c.Parent
var err error
slice, err = ExpandSlice(c.Parent)
if err != nil {
return err
}
}
var err error
slice, err = ExpandSlice(slice)
if err != nil {
return err
}
unit := getUnitName(c)
paths := make(map[string]string)