File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
26
26
| [ Day 13] ( ./src/bin/13.rs ) | ` 90.9µs ` | ` 91.8µs ` |
27
27
| [ Day 14] ( ./src/bin/14.rs ) | ` 30.8µs ` | ` 3.5ms ` |
28
28
| [ Day 15] ( ./src/bin/15.rs ) | ` 119.7µs ` | ` 591.0µs ` |
29
- | [ Day 16] ( ./src/bin/16.rs ) | ` 203 .4µs` | ` 33.3ms ` |
29
+ | [ Day 16] ( ./src/bin/16.rs ) | ` 193 .4µs` | ` 22.6ms ` |
30
30
31
- ** Total: 64.83ms **
31
+ ** Total: 54.12ms **
32
32
<!-- - benchmarking table --->
33
33
34
34
---
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ pub fn part_two(input: &str) -> Option<u64> {
103
103
cost : u64 ,
104
104
}
105
105
106
- const PATH_CAPACITY : usize = 256 ;
106
+ const PATH_CAPACITY : usize = 512 ;
107
107
let path_pool = Pool :: new ( 256 , || Vec :: with_capacity ( PATH_CAPACITY ) ) ;
108
108
let mut path = path_pool. pull ( || Vec :: with_capacity ( PATH_CAPACITY ) ) ;
109
109
path. push ( start) ;
@@ -191,8 +191,7 @@ pub fn part_two(input: &str) -> Option<u64> {
191
191
192
192
let ( pos, dir, cost) = all_options[ idx] ;
193
193
let mut new_path = path_pool. pull ( || Vec :: with_capacity ( PATH_CAPACITY ) ) ;
194
- new_path. clear ( ) ;
195
- new_path. extend ( s. path . iter ( ) ) ;
194
+ new_path. clone_from ( & s. path ) ;
196
195
new_path. push ( pos) ;
197
196
let new_state = State {
198
197
path : new_path,
You can’t perform that action at this time.
0 commit comments