remove_deep2 - fix traversing same element twice

(I hope I don't miss anything, no tests seem to fail and performance is increased significantly) but because `subelement_queue` initiated with the `traverse` all `element`'s subelements will be traversed inside `while` loop twice - once as a part of initial queue and another time when `element` is traversed inside the loop and all those elements added to the queue again.
Now we just initiate the `queue` with the `element` and it will be traversed inside the loop like any other element.
This commit is contained in:
Andrej730
2025-02-21 16:18:36 +05:00
parent f7efbe5924
commit ee2fa739bb
@@ -1489,7 +1489,7 @@ def remove_deep2(
subgraph = list(ifc_file.traverse(element, breadth_first=True))
subgraph.extend(also_consider)
subgraph_set = set(subgraph)
subelement_queue = ifc_file.traverse(element, max_levels=1)
subelement_queue = [element]
while subelement_queue:
subelement = subelement_queue.pop(0)
if (