Improve the automaton producer quality by changing the production order

This commit is contained in:
Clément Renault 2019-10-17 13:08:00 +02:00
parent da71821204
commit 2ea3e9b081

View File

@ -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()))