Skip to content

Commit

Permalink
Reserve the space for the _succs and _preds in AdaptGraph::growTo
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett authored and elazarg committed Oct 23, 2024
1 parent e6ceb8f commit 8be5828
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/crab_utils/adapt_sgraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ class AdaptGraph final {
}

void growTo(size_t v) {
_succs.reserve(v);
_preds.reserve(v);
while (size() < v) {
new_vertex();
}
Expand Down

0 comments on commit 8be5828

Please sign in to comment.