perf: improved collection logic
This commit is contained in:
parent
26850c839c
commit
4d1d9df6a3
1 changed files with 2 additions and 3 deletions
|
|
@ -32,9 +32,8 @@ fn remove_doubles(characters: &Vec<char>) -> Vec<char> {
|
||||||
|
|
||||||
characters
|
characters
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.zip(shortenable_map)
|
||||||
.filter(|(idx, _)| !shortenable_map[*idx])
|
.filter_map(|(c, shortenable)| if shortenable { None } else { Some(*c) })
|
||||||
.map(|(_, itm)| *itm)
|
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue