From e405750aa469baf4fc1d538eec3b70e6084ca278 Mon Sep 17 00:00:00 2001 From: Aditya R Date: Wed, 1 Nov 2023 22:14:39 +0530 Subject: [PATCH] blobinfocache,sqlite: remove unnecessary compression check Following check is not needed and can be removed. Followup fix from https://github.com/containers/image/pull/1645#discussion_r1379024267 Signed-off-by: Aditya R --- pkg/blobinfocache/sqlite/sqlite.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/blobinfocache/sqlite/sqlite.go b/pkg/blobinfocache/sqlite/sqlite.go index e1630f81b..2b446a61c 100644 --- a/pkg/blobinfocache/sqlite/sqlite.go +++ b/pkg/blobinfocache/sqlite/sqlite.go @@ -472,19 +472,15 @@ func (sqc *cache) appendReplacementCandidates(candidates []prioritize.CandidateW } if len(res) == 0 && v2Output { - compressorName := blobinfocache.UnknownCompression compressor, found, err := querySingleValue[string](tx, "SELECT compressor FROM DigestCompressors WHERE digest = ?", digest.String()) if err != nil { return nil, fmt.Errorf("scanning compressorName: %w", err) } if found { - compressorName = compressor - } - if compressorName != blobinfocache.UnknownCompression { res = append(res, prioritize.CandidateWithTime{ Candidate: blobinfocache.BICReplacementCandidate2{ Digest: digest, - CompressorName: compressorName, + CompressorName: compressor, UnknownLocation: true, Location: types.BICLocationReference{Opaque: ""}, },