mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Avoid reallocating cgu_path_components
This commit is contained in:
parent
5248b20d9a
commit
2fa359814a
@ -111,10 +111,12 @@ impl AssertModuleSource<'tcx> {
|
|||||||
(&user_path[..], None)
|
(&user_path[..], None)
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut cgu_path_components = user_path.split('-').collect::<Vec<_>>();
|
let mut iter = user_path.split('-');
|
||||||
|
|
||||||
// Remove the crate name
|
// Remove the crate name
|
||||||
assert_eq!(cgu_path_components.remove(0), crate_name);
|
assert_eq!(iter.next().unwrap(), crate_name);
|
||||||
|
|
||||||
|
let cgu_path_components = iter.collect::<Vec<_>>();
|
||||||
|
|
||||||
let cgu_name_builder = &mut CodegenUnitNameBuilder::new(self.tcx);
|
let cgu_name_builder = &mut CodegenUnitNameBuilder::new(self.tcx);
|
||||||
let cgu_name =
|
let cgu_name =
|
||||||
|
Loading…
Reference in New Issue
Block a user