fix: getting parent for root container error

This commit is contained in:
Zixuan Chen 2024-08-18 15:07:56 +08:00
parent c97f1eec58
commit 3ba8ad5f12
No known key found for this signature in database

View file

@ -216,6 +216,12 @@ impl SharedArena {
}
pub fn get_parent(&self, child: ContainerIdx) -> Option<ContainerIdx> {
if self.get_container_id(child).unwrap().is_root() {
// TODO: PERF: we can speed this up by use a special bit in ContainerIdx to indicate
// whether the target is a root container
return None;
}
self.inner
.parents
.lock()