summaryrefslogtreecommitdiff
path: root/core/math/convex_hull.cpp
diff options
context:
space:
mode:
authorMariano Javier Suligoy <marianognu.easyrpg@gmail.com>2022-11-02 14:59:17 -0300
committerMariano Javier Suligoy <marianognu.easyrpg@gmail.com>2022-11-02 14:59:17 -0300
commit1b00bf932eede2b6791340dc428d9e7d6e54c4f8 (patch)
treed75919f8847ea3aaf18135f592a2ceb4f924c95b /core/math/convex_hull.cpp
parenteddaab17eaffeef3ad38612bf72a901fd0ffcde5 (diff)
Avoid pushing an error because reserve is decreasing the default HasMap capacity
Diffstat (limited to 'core/math/convex_hull.cpp')
-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++) {