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.
2626| [ Day 13] ( ./src/bin/13.rs ) | ` 90.9µs ` | ` 91.8µs ` |
2727| [ Day 14] ( ./src/bin/14.rs ) | ` 30.8µs ` | ` 3.5ms ` |
2828| [ 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 ` |
3030
31- ** Total: 64.83ms **
31+ ** Total: 54.12ms **
3232<!-- - benchmarking table --->
3333
3434---
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ pub fn part_two(input: &str) -> Option<u64> {
103103 cost : u64 ,
104104 }
105105
106- const PATH_CAPACITY : usize = 256 ;
106+ const PATH_CAPACITY : usize = 512 ;
107107 let path_pool = Pool :: new ( 256 , || Vec :: with_capacity ( PATH_CAPACITY ) ) ;
108108 let mut path = path_pool. pull ( || Vec :: with_capacity ( PATH_CAPACITY ) ) ;
109109 path. push ( start) ;
@@ -191,8 +191,7 @@ pub fn part_two(input: &str) -> Option<u64> {
191191
192192 let ( pos, dir, cost) = all_options[ idx] ;
193193 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 ) ;
196195 new_path. push ( pos) ;
197196 let new_state = State {
198197 path : new_path,
You can’t perform that action at this time.
0 commit comments