Remove dead code in quantize_ex_bits to avoid wasted compute (#5384)

Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/5384

Reviewed By: alibeklfc

Differential Revision: D110958833

Pulled By: trang-nm-nguyen

fbshipit-source-id: d831f76bd718e34cc91be6df90c78bd32262db79
This commit is contained in:
lyang24
2026-07-08 17:41:55 -07:00
committed by meta-codesync[bot]
parent caf88fca98
commit 5c1afeed96
-9
View File
@@ -312,15 +312,6 @@ void quantize_ex_bits(
// Step 7: Pack codes into byte array
pack_multibit_codes(tmp_code.data(), ex_code, d, nb_bits);
// Step 8: Compute factors for distance computation
// Reconstruct total_code for factor computation
std::vector<int> total_code(d);
for (size_t i = 0; i < d; i++) {
// Form total_code = (sign << ex_bits) + ex_code
bool sign_bit = (residual[i] >= 0);
total_code[i] = tmp_code[i] + ((sign_bit ? 1 : 0) << ex_bits);
}
// Compute ex-factors; centroid is needed for IP metric correction
compute_ex_factors(
residual,