Revert "Ensure we search back to the first matching prefix"

This reverts commit 89dcf7d7a49366c98e3138586c88b6f1940bea84.
This commit is contained in:
Neil Macneale IV
2025-09-15 18:43:41 +00:00
parent 91746f627d
commit effbf06cbb
-6
View File
@@ -427,12 +427,6 @@ func (ar archiveReader) search(hash hash.Hash) int {
return -1
}
// roll backwards to find the first instance if there are multiple with the same prefix, and the search didn't find
// the first.
for possibleMatch > 0 && ar.indexReader.getPrefix(uint32(possibleMatch-1)) == prefix {
possibleMatch--
}
for idx := uint32(possibleMatch); idx < ar.footer.chunkCount && ar.indexReader.getPrefix(idx) == prefix; idx++ {
if ar.indexReader.getSuffix(idx) == suffix(targetSfx) {
return int(idx)