mirror of
https://github.com/restic/restic.git
synced 2025-11-14 13:13:04 +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.
|
||||
|
||||
Reference in New Issue
Block a user