Skip to content

Commit 851a2cd

Browse files
committed
[lib][rr_graph] pass required variables to lambda function
1 parent 5c2a525 commit 851a2cd

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

libs/librrgraph/src/base/rr_graph_storage.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,8 @@ void t_rr_graph_storage::remove_nodes(std::vector<RRNodeId> nodes_to_remove) {
750750
// entries where either endpoint of an edge is in the nodes_to_remove list.
751751
// It also updates the node IDs of the remaining edges, since node IDs have
752752
// been shifted.
753-
auto adjust_edges = [&](vtr::vector<RREdgeId, RRNodeId>& edge_nodes) {
754-
for (size_t edge_index = 0; edge_index < edge_nodes.size(); ++edge_index) {
755-
RREdgeId edge_id = RREdgeId(edge_index);
756-
RRNodeId node = edge_nodes[edge_id];
757-
753+
auto adjust_edges = [&nodes_to_remove, &removed_edges](vtr::vector<RREdgeId, RRNodeId>& edge_nodes) {
754+
for (auto [edge_id, node] : edge_nodes.pairs()) {
758755
// Find insertion point in the sorted vector
759756
auto node_it = std::lower_bound(nodes_to_remove.begin(), nodes_to_remove.end(), node);
760757

0 commit comments

Comments
 (0)