From 7ba6001ec8fda89e7d513ced2da7b9aa3532cb70 Mon Sep 17 00:00:00 2001 From: Ed Addario Date: Mon, 22 Sep 2025 20:11:54 +0100 Subject: [PATCH] Simplify candidates sorting --- src/llama-quant.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/llama-quant.cpp b/src/llama-quant.cpp index 08e1c97185..f4c0ea0fcd 100644 --- a/src/llama-quant.cpp +++ b/src/llama-quant.cpp @@ -1209,6 +1209,10 @@ static std::unordered_map target_bpw_type( if (a.bytes != b.bytes) { return a.bytes < b.bytes; } return a.error < b.error; }); + const auto last = std::unique(candidates.begin(), candidates.end(), [](const candidate_types & a, const candidate_types & b) { + return a.bytes == b.bytes; + }); + candidates.erase(last, candidates.end()); // Pareto by bytes -> error std::vector pareto;