shrink_to_fit TokenMap's backing storage

This commit is contained in:
Jonas Schievink 2021-01-18 18:40:06 +01:00
parent 9daba961f2
commit 2d799cf5e0
2 changed files with 5 additions and 1 deletions

View file

@ -76,6 +76,8 @@ pub struct HygieneFrame {
impl HygieneFrames {
fn new(db: &dyn AstDatabase, file_id: HirFileId) -> Self {
// Note that this intentionally avoids the `hygiene_frame` query to avoid blowing up memory
// usage. The query is only helpful for nested `HygieneFrame`s as it avoids redundant work.
HygieneFrames(Arc::new(HygieneFrame::new(db, file_id)))
}