storagedriver/s3: Simplified conditional in Walk impl

This commit is contained in:
Collin Shoop
2021-06-24 17:47:54 -04:00
parent c83e9ae10a
commit 48e2373d5b

View File

@@ -1210,12 +1210,10 @@ func (d *driver) doWalk(parentCtx context.Context, objectCount *int64, path, pre
return false
}
if walkDirectories {
if walkInfo.IsDir() {
if err := d.doWalk(ctx, objectCount, *walkInfo.prefix, prefix, walkDirectories, f); err != nil {
retError = err
return false
}
if walkInfo.IsDir() && walkDirectories {
if err := d.doWalk(ctx, objectCount, *walkInfo.prefix, prefix, walkDirectories, f); err != nil {
retError = err
return false
}
}
}