refactor(nodelist): simplify destroying nodes

This commit is contained in:
Nova
2022-06-19 21:43:19 -04:00
parent bbaf95b79f
commit ca57131558

View File

@@ -17,9 +17,8 @@ impl LifeLinkedNodeList {
.read() .read()
.iter() .iter()
.filter_map(|node| node.upgrade()) .filter_map(|node| node.upgrade())
.filter_map(|node| node.get_client().zip(Some(node.get_path().to_string()))) .for_each(|node| {
.for_each(|(client, path)| { node.destroy();
client.scenegraph.remove_node(&path);
}); });
self.nodes.write().clear(); self.nodes.write().clear();
} }