simplified prefix removal, removed unnecessary if-else statements

This commit is contained in:
Alexandr Bruyako
2019-06-30 23:34:47 +03:00
parent 16eeed2ad5
commit 02014be76c
4 changed files with 4 additions and 16 deletions

View File

@@ -175,11 +175,7 @@ const MaxCacheAge = 30 * 24 * time.Hour
func validCacheDirName(s string) bool {
r := regexp.MustCompile(`^[a-fA-F0-9]{64}$`)
if !r.MatchString(s) {
return false
}
return true
return r.MatchString(s)
}
// listCacheDirs returns the list of cache directories.

View File

@@ -214,9 +214,5 @@ func (c *Cache) Has(h restic.Handle) bool {
}
_, err := fs.Stat(c.filename(h))
if err == nil {
return true
}
return false
return err == nil
}