Skip to content

Commit 0b21cc0

Browse files
authored
refactor(storage/s3): remove redundant len check (distribution#4259)
2 parents 01b4555 + 41161a6 commit 0b21cc0

File tree

1 file changed

+8
-10
lines changed
  • registry/storage/driver/s3-aws

1 file changed

+8
-10
lines changed

registry/storage/driver/s3-aws/s3.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,16 +1128,14 @@ func (d *driver) doWalk(parentCtx context.Context, objectCount *int64, from stri
11281128

11291129
// get a list of all inferred directories between the previous directory and this file
11301130
dirs := directoryDiff(prevDir, filePath)
1131-
if len(dirs) > 0 {
1132-
for _, dir := range dirs {
1133-
walkInfos = append(walkInfos, storagedriver.FileInfoInternal{
1134-
FileInfoFields: storagedriver.FileInfoFields{
1135-
IsDir: true,
1136-
Path: dir,
1137-
},
1138-
})
1139-
prevDir = dir
1140-
}
1131+
for _, dir := range dirs {
1132+
walkInfos = append(walkInfos, storagedriver.FileInfoInternal{
1133+
FileInfoFields: storagedriver.FileInfoFields{
1134+
IsDir: true,
1135+
Path: dir,
1136+
},
1137+
})
1138+
prevDir = dir
11411139
}
11421140

11431141
walkInfos = append(walkInfos, storagedriver.FileInfoInternal{

0 commit comments

Comments
 (0)