forked from TrueCloudLab/distribution
refactor(storage/s3): remove redundant len check (#4259)
This commit is contained in:
commit
0b21cc06b0
1 changed files with 8 additions and 10 deletions
|
@ -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
|
||||
dirs := directoryDiff(prevDir, filePath)
|
||||
if len(dirs) > 0 {
|
||||
for _, dir := range dirs {
|
||||
walkInfos = append(walkInfos, storagedriver.FileInfoInternal{
|
||||
FileInfoFields: storagedriver.FileInfoFields{
|
||||
IsDir: true,
|
||||
Path: dir,
|
||||
},
|
||||
})
|
||||
prevDir = dir
|
||||
}
|
||||
for _, dir := range dirs {
|
||||
walkInfos = append(walkInfos, storagedriver.FileInfoInternal{
|
||||
FileInfoFields: storagedriver.FileInfoFields{
|
||||
IsDir: true,
|
||||
Path: dir,
|
||||
},
|
||||
})
|
||||
prevDir = dir
|
||||
}
|
||||
|
||||
walkInfos = append(walkInfos, storagedriver.FileInfoInternal{
|
||||
|
|
Loading…
Reference in a new issue