Use DeleteSubrange when deleting nodes from the graph in the new GraphView.
PiperOrigin-RevId: 269403726
This commit is contained in:
parent
68f0fec1fd
commit
98b54f7d93
@ -1362,7 +1362,12 @@ void MutableGraphView::RemoveNodesInternal(
|
||||
removed_node_index;
|
||||
}
|
||||
nodes_.pop_back();
|
||||
graph()->mutable_node()->RemoveLast();
|
||||
}
|
||||
if (!sorted_node_indices_to_remove.empty()) {
|
||||
const int current_size = graph()->node_size();
|
||||
const int num_to_remove = sorted_node_indices_to_remove.size();
|
||||
graph()->mutable_node()->DeleteSubrange(current_size - num_to_remove,
|
||||
num_to_remove);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user