Replace size() == 0 with is_empty().

This commit is contained in:
Yufeng Ying 2025-03-20 00:07:31 +08:00
parent c7ea8614d7
commit 4f4031a675
147 changed files with 300 additions and 300 deletions

View file

@ -406,7 +406,7 @@ public:
}
Vector<Vector3> convex_points = Geometry3D::compute_convex_mesh_points(&p_convex[0], p_convex.size());
if (convex_points.size() == 0) {
if (convex_points.is_empty()) {
return 0;
}

View file

@ -2237,7 +2237,7 @@ real_t ConvexHullComputer::compute(const Vector3 *p_coords, int32_t p_count, rea
Error ConvexHullComputer::convex_hull(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_mesh) {
r_mesh = Geometry3D::MeshData(); // clear
if (p_points.size() == 0) {
if (p_points.is_empty()) {
return FAILED; // matches QuickHull
}

View file

@ -484,7 +484,7 @@ public:
LOC_OUTSIDE = -1
};
if (polygon.size() == 0) {
if (polygon.is_empty()) {
return polygon;
}

View file

@ -323,7 +323,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
for (List<Face>::Element *&E : new_faces) {
Face &f2 = E->get();
if (f2.points_over.size() == 0) {
if (f2.points_over.is_empty()) {
faces.move_to_front(E);
}
}