Apply review suggestions

Co-Authored-By: Louis Dureuil <louis.dureuil@xinra.net>
This commit is contained in:
Mubelotix
2025-07-15 18:00:37 +02:00
parent 70a860a0f0
commit d6bd60d569

View File

@ -161,12 +161,13 @@ pub fn bucket_sort<'ctx, Q: RankingRuleQueryTrait>(
}; };
} }
let max_total_hits = max_total_hits.unwrap_or(usize::MAX); let max_len_to_evaluate =
while valid_docids.len() < length match (max_total_hits, exhaustive_number_hits && ranking_score_threshold.is_some()) {
|| (exhaustive_number_hits (Some(max_total_hits), true) => max_total_hits,
&& ranking_score_threshold.is_some() _ => length,
&& valid_docids.len() < max_total_hits) };
{
while valid_docids.len() < max_len_to_evaluate {
if time_budget.exceeded() { if time_budget.exceeded() {
loop { loop {
let bucket = std::mem::take(&mut ranking_rule_universes[cur_ranking_rule_index]); let bucket = std::mem::take(&mut ranking_rule_universes[cur_ranking_rule_index]);