feat: hashmap with_capacity
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::hash::Hash;
|
||||
|
||||
use hashbrown::{HashMap, HashSet};
|
||||
|
||||
use derive_more::Constructor;
|
||||
@@ -22,6 +24,10 @@ impl<'vm> AttrSet<'vm> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_capacity(cap: usize) -> Self {
|
||||
AttrSet { data: HashMap::with_capacity(cap) }
|
||||
}
|
||||
|
||||
pub fn push_attr_force(&mut self, sym: usize, val: Value<'vm>) {
|
||||
self.data.insert(sym, val);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user