From 9201870f6cd8ac7813654ca6d784780c7b6b7f6e Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 27 Jun 2022 18:26:56 +0100 Subject: [PATCH] Remove unnecessary code in WalkDir() (#15168) Recalculating forward is useless. It is never used and it will be computed again when calling scanDir() again. --- cmd/metacache-walk.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmd/metacache-walk.go b/cmd/metacache-walk.go index 382f290b7..8c4face7e 100644 --- a/cmd/metacache-walk.go +++ b/cmd/metacache-walk.go @@ -248,11 +248,6 @@ func (s *xlStorage) WalkDir(ctx context.Context, opts WalkDirOptions, wr io.Writ out <- metaCacheEntry{name: pop} if opts.Recursive { // Scan folder we found. Should be in correct sort order where we are. - forward = "" - if len(opts.ForwardTo) > 0 && strings.HasPrefix(opts.ForwardTo, pop) { - forward = strings.TrimPrefix(opts.ForwardTo, pop) - } - err := scanDir(pop) if err != nil && !IsErrIgnored(err, context.Canceled) { logger.LogIf(ctx, err)