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
@@ -109,14 +109,13 @@ func (m *legacyManager) initPaths() error {
slice := "system.slice"
if c.Parent != "" {
- slice = c.Parent
- }
-
var err error
- slice, err = ExpandSlice(slice)
+ slice, err = ExpandSlice(c.Parent)
if err != nil {
return err
}
+ }
+
unit := getUnitName(c)
paths := make(map[string]string)
