From 745024d198c9d9331c18fcd841fbd437e787cc1d Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 18 Nov 2024 01:36:32 +0100 Subject: [PATCH] LiveAPI: always set POD stack var if loop has ran, don't check it No point checking on this, removes an extra instruction. --- src/game/server/liveapi/liveapi.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/game/server/liveapi/liveapi.cpp b/src/game/server/liveapi/liveapi.cpp index 9edbeedd..aa355872 100644 --- a/src/game/server/liveapi/liveapi.cpp +++ b/src/game/server/liveapi/liveapi.cpp @@ -337,8 +337,7 @@ static bool LiveAPI_SetPlayerIdentityFields(HSQUIRRELVM const v, const SQTable* if (sq_isnull(node.key)) continue; - if (!ranLoop) - ranLoop = true; + ranLoop = true; if (!LiveAPI_CheckSwitchType(v, node.key)) return false; @@ -468,8 +467,7 @@ static bool LiveAPI_SetInventoryItem(HSQUIRRELVM const v, const SQTable* const t if (sq_isnull(node.key)) continue; - if (!ranLoop) - ranLoop = true; + ranLoop = true; if (!LiveAPI_CheckSwitchType(v, node.key)) return false; @@ -1723,8 +1721,7 @@ static bool LiveAPI_SetCustomArrayFields(HSQUIRRELVM const v, google::protobuf:: if (sq_isnull(valueObj)) continue; - if (!ranLoop) - ranLoop = true; + ranLoop = true; const SQObjectType valueType = sq_type(valueObj);