summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2022-02-02 00:04:13 +0545
committerAnilforextra <anilforextra@gmail.com>2022-02-02 00:11:09 +0545
commitfc27636999a15f88b1f3b1d7101d84a67968ba06 (patch)
treee3b66fce3dfd70ef1e7d5a4d1543446af2deae47 /core/math
parentea12094f19b028c1dcf6d402b8cbb3296b2065a8 (diff)
Vectors: Use clear() and has().
Use clear() instead of resize(0). Use has() instead of "find(p_val) != -1".
Diffstat (limited to 'core/math')
-rw-r--r--core/math/convex_hull.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp
index 912ffb8b16..bd292f4c2a 100644
--- a/core/math/convex_hull.cpp
+++ b/core/math/convex_hull.cpp
@@ -2129,7 +2129,7 @@ bool ConvexHullInternal::shift_face(Face *p_face, real_t p_amount, LocalVector<V
printf("Needed %d iterations to remove part\n", n);
#endif
- p_stack.resize(0);
+ p_stack.clear();
p_face->origin = shifted_origin;
return true;
@@ -2167,9 +2167,9 @@ real_t ConvexHullComputer::compute(const Vector3 *p_coords, int32_t p_count, rea
return shift;
}
- vertices.resize(0);
- edges.resize(0);
- faces.resize(0);
+ vertices.clear();
+ edges.clear();
+ faces.clear();
LocalVector<ConvexHullInternal::Vertex *> old_vertices;
get_vertex_copy(hull.vertex_list, old_vertices);