Improve the coding style

This commit is contained in:
samuele3hu 2013-12-27 20:07:00 +08:00
parent ee7aa0f077
commit 30439e4689
1 changed files with 6 additions and 17 deletions

View File

@ -627,23 +627,14 @@ int LuaStack::executeFunction(int handler, int numArgs, int numResults, const st
}
// get return value,don't pass LUA_MULTRET to numResults,
if (numResults <= 0)
{
if (traceCallback)
lua_pop(_state, 1);
do {
return 0;
}
if (nullptr == func)
{
if (traceCallback)
lua_pop(_state, 1);
if (numResults <= 0 || nullptr == func)
break;
return 0;
}
func(_state,numResults);
func(_state, numResults);
} while (0);
if (traceCallback)
{
@ -651,8 +642,6 @@ int LuaStack::executeFunction(int handler, int numArgs, int numResults, const st
}
}
lua_settop(_state, 0);
return 1;
}