Skip to content

Commit

Permalink
refactor(storage/s3): remove redundant len check (distribution#4259)
Browse files Browse the repository at this point in the history
  • Loading branch information
milosgajdos authored Jan 18, 2024
2 parents 01b4555 + 41161a6 commit 0b21cc0
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions registry/storage/driver/s3-aws/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 0b21cc0

Please sign in to comment.