Remove unnecessary label bucket loop

Signed-off-by: Jin Dong <djdongjin95@gmail.com>
This commit is contained in:
Jin Dong 2023-06-17 13:54:43 +00:00
parent 96de54db43
commit 1fb835f042

View File

@ -719,15 +719,8 @@ func isSharedContent(tx *bolt.Tx, dgst digest.Digest) bool {
if lbkt == nil {
continue
}
// iterate through each label
lbc := lbkt.Cursor()
for k, v := lbc.First(); k != nil; k, v = lbc.Next() {
if string(k) == labels.LabelSharedNamespace {
if string(v) == "true" && getBlobBucket(tx, ns, dgst) != nil {
return true
}
break
}
if sharedNS := lbkt.Get([]byte(labels.LabelSharedNamespace)); sharedNS != nil && string(sharedNS) == "true" && getBlobBucket(tx, ns, dgst) != nil {
return true
}
}
return false