Simplify the words pair proximity computation

This commit is contained in:
Clément Renault 2020-10-15 16:18:43 +02:00
parent 9021b2dba6
commit 90d4c1d153
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -196,9 +196,8 @@ fn compute_words_pair_proximities(
// We don't care about a word that appear at the
// same position or too far from the other.
if prox >= 1 && prox <= 7 {
match min_prox {
None => min_prox = Some(prox),
Some(mp) => if prox < mp { min_prox = Some(prox) },
if min_prox.map_or(true, |mp| prox < mp) {
min_prox = Some(prox)
}
}
}