From d9540c31ce45dfa72127df61eb51303d2d7ecbae Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 14 May 2020 21:58:10 -0400 Subject: [PATCH] CElitePirate: Simplify IsArmClawCollider() We can collapse this down into a std::any_of call. --- Runtime/MP1/World/CElitePirate.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Runtime/MP1/World/CElitePirate.cpp b/Runtime/MP1/World/CElitePirate.cpp index 8d3602796..077c530ac 100644 --- a/Runtime/MP1/World/CElitePirate.cpp +++ b/Runtime/MP1/World/CElitePirate.cpp @@ -1,5 +1,8 @@ #include "Runtime/MP1/World/CElitePirate.hpp" +#include +#include + #include "Runtime/Camera/CFirstPersonCamera.hpp" #include "Runtime/Collision/CCollisionActor.hpp" #include "Runtime/Collision/CCollisionActorManager.hpp" @@ -884,12 +887,7 @@ bool CElitePirate::IsArmClawCollider(std::string_view name, std::string_view loc if (name == locator) { return true; } - for (size_t i = 0; i < infoCount; ++i) { - if (name == info[i].from) { - return true; - } - } - return false; + return std::any_of(info, info + infoCount, [&name](const auto& entry) { return entry.from == name; }); } void CElitePirate::CreateGrenadeLauncher(CStateManager& mgr, TUniqueId uid) {