]> ruderich.org/simon Gitweb - safcm/safcm.git/commitdiff
sync: remove duplicate code in triggerPaths()
authorSimon Ruderich <simon@ruderich.org>
Sun, 9 May 2021 10:28:33 +0000 (12:28 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 9 May 2021 13:15:43 +0000 (15:15 +0200)
cmd/safcm-remote/sync/triggers.go

index 34aae7df45b808bf878288caa293fef898970521..d201835e7e7271b9729da033a409c53b004edce9 100644 (file)
@@ -51,9 +51,7 @@ func (s *Sync) queueTriggers(file *safcm.File) {
 // "/" or ".", then the parents and finally path itself).
 func triggerPaths(path string) []string {
        sep := string(filepath.Separator)
-       if path == sep {
-               return []string{path}
-       } else if path == "." {
+       if path == sep || path == "." {
                return []string{path}
        }
        parts := strings.Split(path, sep)