Skip to content

Commit

Permalink
Avoid pushing an error because reserve is decreasing the default HasM…
Browse files Browse the repository at this point in the history
…ap capacity
  • Loading branch information
MarianoGnu committed Nov 2, 2022
1 parent eddaab1 commit 1b00bf9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/math/convex_hull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2274,8 +2274,7 @@ Error ConvexHullComputer::convex_hull(const Vector<Vector3> &p_points, Geometry3

// Copy the edges over. There's two "half-edges" for every edge, so we pick only one of them.
r_mesh.edges.resize(ch.edges.size() / 2);
OAHashMap<uint64_t, int32_t> edge_map;
edge_map.reserve(ch.edges.size() * 4); // The higher the capacity, the faster the insert
OAHashMap<uint64_t, int32_t> edge_map(ch.edges.size() * 4); // The higher the capacity, the faster the insert

uint32_t edges_copied = 0;
for (uint32_t i = 0; i < ch.edges.size(); i++) {
Expand Down

0 comments on commit 1b00bf9

Please sign in to comment.