Skip to content

Commit

Permalink
grt: check if routelen > 0 before resizing
Browse files Browse the repository at this point in the history
Signed-off-by: Eder Monteiro <[email protected]>
  • Loading branch information
eder-matheus committed Jan 25, 2024
1 parent ff63379 commit 81f2a31
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/grt/src/fastroute/src/maze3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,11 @@ int FastRouteCore::copyGrids3D(std::vector<TreeNode>& treenodes,
const int n1l = treenodes[n1].botL;
const int routelen = treeedges[edge_n1n2].route.routelen;

gridsX_n1n2.reserve(routelen + 1);
gridsY_n1n2.reserve(routelen + 1);
gridsL_n1n2.reserve(routelen + 1);
if (routelen > 0) {
gridsX_n1n2.reserve(routelen + 1);
gridsY_n1n2.reserve(routelen + 1);
gridsL_n1n2.reserve(routelen + 1);
}

int cnt = 0;
if (treeedges[edge_n1n2].n1 == n1) { // n1 is the first node of (n1, n2)
Expand Down

0 comments on commit 81f2a31

Please sign in to comment.