Skip to content

Commit

Permalink
[ui] graph: minor code change for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiencastan committed Jan 4, 2021
1 parent d1d78e9 commit a17bc3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion meshroom/ui/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,11 @@ def removeNodesFrom(self, startNode):
startNode (Node): the node to start from.
"""
with self.groupedGraphModification("Remove Nodes from {}".format(startNode.name)):
nodes, _ = self._graph.dfsOnDiscover(startNodes=[startNode], reverse=True, dependenciesOnly=True)
# Perform nodes removal from leaves to start node so that edges
# can be re-created in correct order on redo.
[self.removeNode(node) for node in reversed(self._graph.dfsOnDiscover(startNodes=[startNode], reverse=True, dependenciesOnly=True)[0])]
for node in reversed(nodes):
self.removeNode(node)

@Slot(Attribute, Attribute)
def addEdge(self, src, dst):
Expand Down

0 comments on commit a17bc3d

Please sign in to comment.