fix: node reclaimation
This commit is contained in:
1 parent
5713e13ff2
commit
bffb2644a3
6 files changed
+129
-125
No files matched your search
@@ -54,6 +54,15 @@ impl<'a> VNode<'a> {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
pub fn dynamic_root(&self, idx: usize) -> Option<&'a DynamicNode<'a>> {
|
||||
match &self.template.roots[idx] {
|
||||
TemplateNode::Element { .. } | TemplateNode::Text(_) => None,
|
||||
TemplateNode::Dynamic(id) | TemplateNode::DynamicText(id) => {
|
||||
Some(&self.dynamic_nodes[*id])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
|
||||
Reference in new issue
Block a user