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> {
103103 cost : u64 ,
104104 }
105105
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 ) ) ;
108109 path. push ( start) ;
109110
110111 let mut q = VecDeque :: new ( ) ;
@@ -189,7 +190,7 @@ pub fn part_two(input: &str) -> Option<u64> {
189190 }
190191
191192 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 ) ) ;
193194 new_path. clear ( ) ;
194195 new_path. extend ( s. path . iter ( ) ) ;
195196 new_path. push ( pos) ;
You can’t perform that action at this time.
0 commit comments