Reserve 1 instead of 4 ProcValue entries for most procs

This commit is contained in:
Tad Hardesty 2021-12-04 16:16:59 -08:00
parent f82df10f80
commit 8b47ea8147

View file

@ -1097,7 +1097,10 @@ impl ObjectTreeBuilder {
code: Option<Block>,
) -> Result<(usize, &mut ProcValue), DMError> {
let node = &mut self.inner.graph[parent.index()];
let proc = node.procs.entry(name.to_owned()).or_insert_with(Default::default);
let proc = node.procs.entry(name.to_owned()).or_insert_with(|| TypeProc {
value: Vec::with_capacity(1),
declaration: None,
});
if let Some(kind) = declaration {
if let Some(ref decl) = proc.declaration {
DMError::new(location, format!("duplicate definition of {}/{}", kind, name))