mirror of
https://github.com/restic/restic.git
synced 2025-08-12 17:37:40 +00:00
simplified prefix removal, removed unnecessary if-else statements
This commit is contained in:
6
internal/cache/cache.go
vendored
6
internal/cache/cache.go
vendored
@@ -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.
|
||||
|
6
internal/cache/file.go
vendored
6
internal/cache/file.go
vendored
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user