Skip to content

Commit

Permalink
Remove shrink_to methods
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Sep 11, 2024
1 parent 45e0d59 commit 843169d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
5 changes: 0 additions & 5 deletions crates/oxc_semantic/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,6 @@ impl<'a> AstNodes<'a> {
self.nodes.reserve(additional);
self.parent_ids.reserve(additional);
}

pub fn shrink_to(&mut self, capacity: usize) {
self.nodes.shrink_to(capacity);
self.parent_ids.shrink_to(capacity);
}
}

#[derive(Debug, Clone)]
Expand Down
11 changes: 0 additions & 11 deletions crates/oxc_semantic/src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,4 @@ impl ScopeTree {
self.child_ids.reserve(additional);
}
}

/// Shrink allocations to a certain number of scopes.
pub fn shrink_to(&mut self, capacity: usize) {
self.parent_ids.shrink_to(capacity);
self.flags.shrink_to(capacity);
self.bindings.shrink_to(capacity);
self.node_ids.shrink_to(capacity);
if self.build_child_ids {
self.child_ids.shrink_to(capacity);
}
}
}
12 changes: 0 additions & 12 deletions crates/oxc_semantic/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,6 @@ impl SymbolTable {

self.references.reserve(additional_references);
}

pub fn shrink_to(&mut self, capacity_symbols: usize, capacity_references: usize) {
self.spans.shrink_to(capacity_symbols);
self.names.shrink_to(capacity_symbols);
self.flags.shrink_to(capacity_symbols);
self.scope_ids.shrink_to(capacity_symbols);
self.declarations.shrink_to(capacity_symbols);
self.resolved_references.shrink_to(capacity_symbols);
self.redeclarations.shrink_to(capacity_symbols);

self.references.shrink_to(capacity_references);
}
}

/// Checks whether the a identifier reference is a global value or not.
Expand Down

0 comments on commit 843169d

Please sign in to comment.