From 2ea3e9b081160a8447c6456b1b987c28a3a1a99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Thu, 17 Oct 2019 13:08:00 +0200 Subject: [PATCH] Improve the automaton producer quality by changing the production order --- meilidb-core/src/automaton/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meilidb-core/src/automaton/mod.rs b/meilidb-core/src/automaton/mod.rs index 4281a8c21..0f7e3137d 100644 --- a/meilidb-core/src/automaton/mod.rs +++ b/meilidb-core/src/automaton/mod.rs @@ -210,9 +210,9 @@ fn generate_automatons( // order automatons, the most important first, // we keep the original automatons at the front. - automatons[1..].sort_unstable_by_key(|a| { + automatons[1..].sort_by_key(|a| { let a = a.first().unwrap(); - (Reverse(a.is_exact), Reverse(a.ngram)) + (Reverse(a.is_exact), a.ngram) }); Ok((automatons, enhancer_builder.build()))