misc optimizations

This commit is contained in:
swaits committed 2021-12-07 22:28:46 -07:00
1 parent feca3062c8
commit d1dcb5134a
7 files changed
+516 -48

No files matched your search

+2 -2
View File
@@ -39,8 +39,8 @@ fn find_oxygen_or_co2(s: &str, oxygen: bool) -> usize {
.rev()
.map(|bit| {
// split current set into ones/zeroes for current bit
let mut ones = vec![];
let mut zeroes = vec![];
let mut ones = Vec::with_capacity(kept.len());
let mut zeroes = Vec::with_capacity(kept.len());
kept.iter().for_each(|x| {
if x & (1 << bit) != 0 {
ones.push(*x);