mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-20 07:13:06 +00:00
shrink_to_fit()
in more places
This saves 18mb on `analysis-stats .`, without regressing speed.
This commit is contained in:
parent
5ff4ba347d
commit
1fe060719a
8 changed files with 51 additions and 27 deletions
|
@ -422,8 +422,8 @@ impl CrateGraphBuilder {
|
|||
edition: Edition,
|
||||
display_name: Option<CrateDisplayName>,
|
||||
version: Option<String>,
|
||||
cfg_options: CfgOptions,
|
||||
potential_cfg_options: Option<CfgOptions>,
|
||||
mut cfg_options: CfgOptions,
|
||||
mut potential_cfg_options: Option<CfgOptions>,
|
||||
mut env: Env,
|
||||
origin: CrateOrigin,
|
||||
is_proc_macro: bool,
|
||||
|
@ -431,6 +431,10 @@ impl CrateGraphBuilder {
|
|||
ws_data: Arc<CrateWorkspaceData>,
|
||||
) -> CrateBuilderId {
|
||||
env.entries.shrink_to_fit();
|
||||
cfg_options.shrink_to_fit();
|
||||
if let Some(potential_cfg_options) = &mut potential_cfg_options {
|
||||
potential_cfg_options.shrink_to_fit();
|
||||
}
|
||||
self.arena.alloc(CrateBuilder {
|
||||
basic: CrateData {
|
||||
root_file_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue