|
@@ -299,6 +299,19 @@ r_flatten(PandaNode *grandparent_node, PandaNode *parent_node,
|
|
|
num_nodes += flatten_siblings(parent_node, combine_siblings_bits);
|
|
num_nodes += flatten_siblings(parent_node, combine_siblings_bits);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // Finally, if any of our remaining children are plain PandaNodes
|
|
|
|
|
+ // with no children, just remove them.
|
|
|
|
|
+ {
|
|
|
|
|
+ for (int i = parent_node->get_num_children() - 1; i >= 0; --i) {
|
|
|
|
|
+ PandaNode *child_node = parent_node->get_child(i);
|
|
|
|
|
+ if (child_node->is_exact_type(PandaNode::get_class_type()) &&
|
|
|
|
|
+ child_node->get_num_children() == 0) {
|
|
|
|
|
+ parent_node->remove_child(child_node);
|
|
|
|
|
+ ++num_nodes;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return num_nodes;
|
|
return num_nodes;
|