Skip to content

Commit

Permalink
removed other setdiff call
Browse files Browse the repository at this point in the history
  • Loading branch information
dlcole3 committed Sep 25, 2024
1 parent 1d2eb82 commit 7c060ed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/backends/moi_backend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,12 @@ function _copy_node_variables(
# note that existing node variables are not copied per-se; the references
# now point to multiple MOI backends.
vars_to_add = setdiff(node_variables, keys(dest.element_to_graph_map.var_map))
for var in vars_to_add
src_graph_index = graph_index(var)
dest_graph_index = MOI.add_variable(dest, var)
index_map[src_graph_index] = dest_graph_index
for var in node_variables
if !(var in keys(dest.element_to_graph_map))
src_graph_index = graph_index(var)
dest_graph_index = MOI.add_variable(dest, var)
index_map[src_graph_index] = dest_graph_index
end
end

# pass variable attributes
Expand Down

0 comments on commit 7c060ed

Please sign in to comment.