refactor(physics): tornar std::ranges::find a bucle for explícit

This commit is contained in:
2026-05-26 13:49:16 +02:00
parent 97d3749269
commit 5e4d2cf993
+5 -3
View File
@@ -3,7 +3,6 @@
#include "core/physics/physics_world.hpp" #include "core/physics/physics_world.hpp"
#include <algorithm>
#include <cmath> #include <cmath>
#include "core/physics/rigid_body.hpp" #include "core/physics/rigid_body.hpp"
@@ -14,9 +13,12 @@ namespace Physics {
if (body == nullptr) { if (body == nullptr) {
return; return;
} }
if (std::ranges::find(bodies_, body) == bodies_.end()) { for (const auto* b : bodies_) {
bodies_.push_back(body); if (b == body) {
return;
}
} }
bodies_.push_back(body);
} }
void PhysicsWorld::removeBody(RigidBody* body) { void PhysicsWorld::removeBody(RigidBody* body) {