From 16278ba9129110aeb76afd40173039a0195b8fde Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 27 Sep 2006 08:48:26 +0000 Subject: [PATCH] just push the function; one less thing to do during dispatch --- stepmania/src/LuaBinding.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stepmania/src/LuaBinding.h b/stepmania/src/LuaBinding.h index a3e1458814..3e74f61796 100644 --- a/stepmania/src/LuaBinding.h +++ b/stepmania/src/LuaBinding.h @@ -58,7 +58,7 @@ public: { const RegType *l = &(*s_pvMethods)[i]; lua_pushstring( L, l->szName ); - lua_pushlightuserdata( L, (void*)l ); + lua_pushlightuserdata( L, (void*) l->mfunc ); lua_pushcclosure( L, thunk, 1 ); lua_settable( L, methods ); } @@ -142,8 +142,8 @@ private: T *obj = check( L, 1, true ); // get self lua_remove(L, 1); // remove self so member function args start at index 1 // get member function from upvalue - RegType *l = (RegType *) lua_touserdata( L, lua_upvalueindex(1) ); - return (*(l->mfunc))(obj,L); // call member function + binding_t *pFunc = (binding_t *) lua_touserdata( L, lua_upvalueindex(1) ); + return pFunc( obj, L ); // call member function } /* Two objects are equal if the underlying object is the same. */