refactor(storage/s3): remove redundant len check

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2024-01-17 18:27:05 +08:00
parent 01b4555d59
commit 41161a6e12
No known key found for this signature in database
GPG key ID: DAEBBD2E34C111E6

View file

@ -1128,16 +1128,14 @@ func (d *driver) doWalk(parentCtx context.Context, objectCount *int64, from stri
// get a list of all inferred directories between the previous directory and this file // get a list of all inferred directories between the previous directory and this file
dirs := directoryDiff(prevDir, filePath) dirs := directoryDiff(prevDir, filePath)
if len(dirs) > 0 { for _, dir := range dirs {
for _, dir := range dirs { walkInfos = append(walkInfos, storagedriver.FileInfoInternal{
walkInfos = append(walkInfos, storagedriver.FileInfoInternal{ FileInfoFields: storagedriver.FileInfoFields{
FileInfoFields: storagedriver.FileInfoFields{ IsDir: true,
IsDir: true, Path: dir,
Path: dir, },
}, })
}) prevDir = dir
prevDir = dir
}
} }
walkInfos = append(walkInfos, storagedriver.FileInfoInternal{ walkInfos = append(walkInfos, storagedriver.FileInfoInternal{