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 <algorithm>
#include <cmath>
#include "core/physics/rigid_body.hpp"
@@ -14,10 +13,13 @@ namespace Physics {
if (body == nullptr) {
return;
}
if (std::ranges::find(bodies_, body) == bodies_.end()) {
bodies_.push_back(body);
for (const auto* b : bodies_) {
if (b == body) {
return;
}
}
bodies_.push_back(body);
}
void PhysicsWorld::removeBody(RigidBody* body) {
std::erase(bodies_, body);