File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
compiler/rustc_mir_dataflow/src Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -364,12 +364,13 @@ impl<'tcx> Map<'tcx> {
364
364
/// chosen is an implementation detail and may not be relied upon (other than that their type
365
365
/// are scalars).
366
366
pub fn new ( tcx : TyCtxt < ' tcx > , body : & Body < ' tcx > , value_limit : Option < usize > ) -> Self {
367
+ let capacity = 4 * body. local_decls . len ( ) + value_limit. unwrap_or ( body. local_decls . len ( ) ) ;
367
368
let mut map = Self {
368
369
locals : IndexVec :: from_elem ( None , & body. local_decls ) ,
369
370
projections : FxHashMap :: default ( ) ,
370
- places : IndexVec :: new ( ) ,
371
+ places : IndexVec :: with_capacity ( capacity ) ,
371
372
value_count : 0 ,
372
- inner_values : IndexVec :: new ( ) ,
373
+ inner_values : IndexVec :: with_capacity ( capacity ) ,
373
374
inner_values_buffer : Vec :: new ( ) ,
374
375
} ;
375
376
map. register_locals ( tcx, body) ;
You can’t perform that action at this time.
0 commit comments