backend: Deduplicate sanity checks for parameters of Load() method

The check is now handled by backend.DefaultLoad. This also guarantees
consistent behavior across all backends.
This commit is contained in:
Michael Eischer
2023-04-07 21:29:01 +02:00
parent bdcafbc11c
commit 8bfc2519d7
9 changed files with 10 additions and 71 deletions

View File

@@ -114,9 +114,6 @@ func (be *MemoryBackend) Load(ctx context.Context, h restic.Handle, length int,
}
func (be *MemoryBackend) openReader(ctx context.Context, h restic.Handle, length int, offset int64) (io.ReadCloser, error) {
if err := h.Valid(); err != nil {
return nil, backoff.Permanent(err)
}
be.sem.GetToken()
be.m.Lock()