Skip to content

Commit b25e7e0

Browse files
committed
WIP, using higher-order functions
1 parent da4eff0 commit b25e7e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/GraphsDFG/services/GraphsDFG.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -391,18 +391,18 @@ function _copyIntoGraph!(sourceDFG::GraphsDFG, destDFG::GraphsDFG, variableFacto
391391
for factor in sourceFactors
392392
if !haskey(destDFG.labelDict, factor.dfgNode.label)
393393
# 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
396396
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))
400400
#otherwise ignore
401401
end
402402
end
403403

404404
# 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)
406406
addFactor!(destDFG, factVariables, deepcopy(factor.dfgNode))
407407
end
408408
end

0 commit comments

Comments
 (0)