mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Use capacity when constructing aliases
This commit is contained in:
parent
0d642929aa
commit
e3dbf5c09c
2 changed files with 8 additions and 1 deletions
|
@ -143,6 +143,13 @@ pub struct Aliases {
|
|||
}
|
||||
|
||||
impl Aliases {
|
||||
pub fn with_capacity(cap: usize) -> Self {
|
||||
Self {
|
||||
aliases: Vec::with_capacity(cap),
|
||||
variables: Vec::with_capacity(cap * 2),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, symbol: Symbol, alias: Alias) {
|
||||
let alias_variables =
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue