File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,9 @@ pub fn part_two(input: &str) -> Option<u64> {
103
103
cost : u64 ,
104
104
}
105
105
106
- let path_pool = Pool :: new ( 32 , || Vec :: with_capacity ( 1024 ) ) ;
107
- let mut path = path_pool. pull ( || Vec :: with_capacity ( 1024 ) ) ;
106
+ const PATH_CAPACITY : usize = 256 ;
107
+ let path_pool = Pool :: new ( 256 , || Vec :: with_capacity ( PATH_CAPACITY ) ) ;
108
+ let mut path = path_pool. pull ( || Vec :: with_capacity ( PATH_CAPACITY ) ) ;
108
109
path. push ( start) ;
109
110
110
111
let mut q = VecDeque :: new ( ) ;
@@ -189,7 +190,7 @@ pub fn part_two(input: &str) -> Option<u64> {
189
190
}
190
191
191
192
let ( pos, dir, cost) = all_options[ idx] ;
192
- let mut new_path = path_pool. pull ( || Vec :: with_capacity ( 1024 ) ) ;
193
+ let mut new_path = path_pool. pull ( || Vec :: with_capacity ( PATH_CAPACITY ) ) ;
193
194
new_path. clear ( ) ;
194
195
new_path. extend ( s. path . iter ( ) ) ;
195
196
new_path. push ( pos) ;
You can’t perform that action at this time.
0 commit comments