Save 2 pointers in TerminatorKind
(96 → 80 bytes)
These things don't need to be `Vec`s; boxed slices are enough. The frequent one here is call arguments, but MIR building knows the number of arguments from the THIR, so the collect is always getting the allocation right in the first place, and thus this shouldn't ever add the shrink-in-place overhead.
This commit is contained in:
parent
25c9f2ca06
commit
b28efb11af
16 changed files with 72 additions and 72 deletions
|
@ -562,7 +562,7 @@ impl<'tcx> CloneShimBuilder<'tcx> {
|
|||
vec![statement],
|
||||
TerminatorKind::Call {
|
||||
func,
|
||||
args: vec![Spanned { node: Operand::Move(ref_loc), span: DUMMY_SP }],
|
||||
args: [Spanned { node: Operand::Move(ref_loc), span: DUMMY_SP }].into(),
|
||||
destination: dest,
|
||||
target: Some(next),
|
||||
unwind: UnwindAction::Cleanup(cleanup),
|
||||
|
@ -843,7 +843,7 @@ fn build_call_shim<'tcx>(
|
|||
};
|
||||
|
||||
// BB #0
|
||||
let args = args.into_iter().map(|a| Spanned { node: a, span: DUMMY_SP }).collect::<Vec<_>>();
|
||||
let args = args.into_iter().map(|a| Spanned { node: a, span: DUMMY_SP }).collect();
|
||||
block(
|
||||
&mut blocks,
|
||||
statements,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue