Skip to content

Commit

Permalink
perf: reserve space for vectors in sgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
caballa committed Oct 23, 2024
1 parent ccbc3e6 commit 418b63c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/crab/domains/graphs/adapt_sgraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ template <class Weight> class AdaptGraph {
}

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

0 comments on commit 418b63c

Please sign in to comment.