@@ -391,18 +391,18 @@ function _copyIntoGraph!(sourceDFG::GraphsDFG, destDFG::GraphsDFG, variableFacto
391
391
for factor in sourceFactors
392
392
if ! haskey (destDFG. labelDict, factor. dfgNode. label)
393
393
# Get the original factor variables (we need them to create it)
394
- variables = in_neighbors (factor, sourceDFG. g)
395
- # Find the labels and associated variables in our new subgraph
394
+ neighVarIds = getNeighbors (sourceDFG, factor . dfgNode . label) # OLD: in_neighbors(factor, sourceDFG.g)
395
+ # Find the labels and associated neighVarIds in our new subgraph
396
396
factVariables = DFGVariable[]
397
- for variable in variables
398
- if haskey (destDFG. labelDict, variable . dfgNode . label )
399
- push! (factVariables, getVariable (destDFG, variable . dfgNode . label ))
397
+ for neighVarId in neighVarIds
398
+ if haskey (destDFG. labelDict, neighVarId )
399
+ push! (factVariables, getVariable (destDFG, neighVarId ))
400
400
# otherwise ignore
401
401
end
402
402
end
403
403
404
404
# Only if we have all of them should we add it (otherwise strange things may happen on evaluation)
405
- if includeOrphanFactors || length (factVariables) == length (variables )
405
+ if includeOrphanFactors || length (factVariables) == length (neighVarIds )
406
406
addFactor! (destDFG, factVariables, deepcopy (factor. dfgNode))
407
407
end
408
408
end
0 commit comments