day05 performance push part 2 through more efficient case insensitive comparison

This commit is contained in:
Johannes Schaefer
2018-12-05 15:19:12 +01:00
parent 32843531f8
commit d10d36498c

View File

@@ -22,7 +22,7 @@ pub fn task2() {
reduce(
&input
.chars()
.filter(|ch| ch.to_lowercase().next().unwrap() != c)
.filter(|ch| ch.eq_ignore_ascii_case(&c))
.collect::<String>(),
).len(),
)