mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 10:17:27 +02:00
[core][graph] store duplication result in an OrderedDict
allows to keep the order in which duplicated nodes were created
This commit is contained in:
parent
e6e2c18aa8
commit
41ea5a5423
1 changed files with 4 additions and 3 deletions
|
@ -5,7 +5,7 @@ import logging
|
|||
import os
|
||||
import re
|
||||
import weakref
|
||||
from collections import defaultdict
|
||||
from collections import defaultdict, OrderedDict
|
||||
from contextlib import contextmanager
|
||||
|
||||
from enum import Enum
|
||||
|
@ -363,10 +363,11 @@ class Graph(BaseObject):
|
|||
fromNode (Node): the node to start the duplication from
|
||||
|
||||
Returns:
|
||||
Dict[Node, Node]: the source->duplicate map
|
||||
OrderedDict[Node, Node]: the source->duplicate map
|
||||
"""
|
||||
srcNodes, srcEdges = self.nodesFromNode(fromNode)
|
||||
duplicates = {}
|
||||
# use OrderedDict to keep duplicated nodes creation order
|
||||
duplicates = OrderedDict()
|
||||
|
||||
with GraphModification(self):
|
||||
duplicateEdges = {}
|
||||
|
|
Loading…
Add table
Reference in a new issue