diff --git a/README.md b/README.md index affda65..08a9d3d 100644 --- a/README.md +++ b/README.md @@ -59,9 +59,9 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www. | [Day 19](./src/bin/19.rs) | `83.9µs` | `90.9µs` | | [Day 20](./src/bin/20.rs) | `323.9µs` | `1.2ms` | | [Day 21](./src/bin/21.rs) | `64.1µs` | `494.7µs` | -| [Day 22](./src/bin/22.rs) | `85.3µs` | `205.8µs` | +| [Day 22](./src/bin/22.rs) | `82.4µs` | `202.8µs` | -**Total: 16.63ms** +**Total: 16.62ms** --- diff --git a/src/bin/22.rs b/src/bin/22.rs index 700483f..9c497b9 100644 --- a/src/bin/22.rs +++ b/src/bin/22.rs @@ -24,7 +24,7 @@ pub fn part_two(input: &str) -> Option { .map(|brick| { let mut fall_count = 0; let mut visited = vec![false; tower.bricks.len()]; - let mut stack = Vec::new(); + let mut stack = Vec::with_capacity(16); visited[brick] = true; stack.push(brick); while let Some(cur) = stack.pop() {