Skip to content

Commit

Permalink
Memory optmization
Browse files Browse the repository at this point in the history
  • Loading branch information
moOsama76 committed Jan 5, 2025
1 parent ca79509 commit fb422f7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,23 +227,23 @@ impl MessageHandler<GraphOperationMessage, GraphOperationMessageData<'_>> for Gr
});
}

for artboard in artboard_data.clone() {
for artboard in &artboard_data {
// modify downstream connections
responses.add(NodeGraphMessage::SetInput {
input_connector: InputConnector::node(artboard.1.merge_node, 1),
input: NodeInput::node(artboard.1.input_node.as_node().unwrap_or_default(), 0),
});

// Modify upstream connections
for outward_wire in artboard.1.output_nodes {
for outward_wire in &artboard.1.output_nodes {
if let Some(artboard_info) = artboard_data.get(&outward_wire.node_id().unwrap_or_default()) {
responses.add(NodeGraphMessage::SetInput {
input_connector: InputConnector::node(artboard_info.merge_node, outward_wire.input_index()),
input: NodeInput::node(artboard_data[&artboard.0].merge_node, 0),
});
} else {
responses.add(NodeGraphMessage::SetInput {
input_connector: outward_wire,
input_connector: *outward_wire,
input: NodeInput::node(artboard_data[&artboard.0].merge_node, 0),
});
}
Expand Down

0 comments on commit fb422f7

Please sign in to comment.