From 2a5997fb20a3cdea154b59e81925859b734df350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Thu, 30 Mar 2023 13:07:17 +0200 Subject: [PATCH] Avoid expensive assert! in bucket sort function --- milli/src/search/new/ranking_rules.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/milli/src/search/new/ranking_rules.rs b/milli/src/search/new/ranking_rules.rs index 1f5f4b366..9dc6018e6 100644 --- a/milli/src/search/new/ranking_rules.rs +++ b/milli/src/search/new/ranking_rules.rs @@ -206,7 +206,9 @@ pub fn bucket_sort<'ctx, Q: RankingRuleQueryTrait>( &next_bucket.candidates, ); - assert!(ranking_rule_universes[cur_ranking_rule_index].is_superset(&next_bucket.candidates)); + debug_assert!( + ranking_rule_universes[cur_ranking_rule_index].is_superset(&next_bucket.candidates) + ); ranking_rule_universes[cur_ranking_rule_index] -= &next_bucket.candidates; if cur_ranking_rule_index == ranking_rules_len - 1