From 8804607be4654393f421b278241e865d7aa1196f Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Wed, 4 Sep 2024 00:59:50 -0700 Subject: [PATCH] ActorFrame: replace a switch with an if/else More of a stylistic change than an optimization, but makes it easier to understand what's happening. --- src/ActorFrame.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ActorFrame.cpp b/src/ActorFrame.cpp index 675ca4c35d..3d9a9cd00d 100644 --- a/src/ActorFrame.cpp +++ b/src/ActorFrame.cpp @@ -413,17 +413,17 @@ void ActorFrame::PushChildTable(lua_State* L, const RString &sName) { if(a->GetName() == sName) { - switch(found) + if (found == 0) { - case 0: - a->PushSelf(L); - break; - case 1: - CreateChildTable(L, a); - break; - default: - AddToChildTable(L, a); - break; + a->PushSelf(L); + } + else if (found == 1) + { + CreateChildTable(L, a); + } + else + { + AddToChildTable(L, a); } ++found; }