summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-21 18:29:38 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-21 18:29:38 +0100
commit186f6f0d874e830cc4597710eb0bab12a20bca20 (patch)
tree4719b75b270e6b9b8a885e46d31fc68a81a3fa1d /core/math
parent0566afa041d9574ca502053f7492ac369a306819 (diff)
parente0e45e013e477ab55641a1b52aa24f219daf0e98 (diff)
Merge pull request #70403 from rburing/fix_edge_map_capacity
Fix edge map capacity in convex hull computer
Diffstat (limited to 'core/math')
-rw-r--r--core/math/convex_hull.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp
index 561970d2ee..51d88d8ea0 100644
--- a/core/math/convex_hull.cpp
+++ b/core/math/convex_hull.cpp
@@ -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++) {