From 5e4d2cf9935d700f40a240f02c07de59c2b29d1f Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Tue, 26 May 2026 13:49:16 +0200 Subject: [PATCH] =?UTF-8?q?refactor(physics):=20tornar=20std::ranges::find?= =?UTF-8?q?=20a=20bucle=20for=20expl=C3=ADcit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/core/physics/physics_world.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/core/physics/physics_world.cpp b/source/core/physics/physics_world.cpp index 7eb5654..8473124 100644 --- a/source/core/physics/physics_world.cpp +++ b/source/core/physics/physics_world.cpp @@ -3,7 +3,6 @@ #include "core/physics/physics_world.hpp" -#include #include #include "core/physics/rigid_body.hpp" @@ -14,9 +13,12 @@ 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) {