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.
This commit is contained in:
sukibaby
2024-09-30 17:17:02 -07:00
committed by teejusb
parent 93c15f9b15
commit 8804607be4
+10 -10
View File
@@ -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;
}