This commit is contained in:
Book-reader 2025-05-10 02:06:53 +12:00
parent 623b068cef
commit 26f5196138

View file

@ -94,6 +94,7 @@ pub fn check(query: &String) -> Option<SpellCheckResults> {
if closest_match.1 <= MAX_DISTANCE {
cache.insert(qword.to_owned(), Some(*closest_match.0));
distances.push(SpellCheckResult{orig: qword.to_owned(), correction: *closest_match.0});
} else {
// even though there is no close enough match, cache it anyway so that it doesn't have to be looked up every time
cache.insert(qword.to_owned(), None);