Use only lowercase characters to determine if query matches a candidate

This commit is contained in:
Antonio Scandurra 2022-01-13 15:07:48 +01:00
parent d6ed2ba642
commit 5f2ac61401
2 changed files with 12 additions and 7 deletions

View file

@ -9,6 +9,7 @@ impl CharBag {
}
fn insert(&mut self, c: char) {
let c = c.to_ascii_lowercase();
if c >= 'a' && c <= 'z' {
let mut count = self.0;
let idx = c as u8 - 'a' as u8;