Unverified Commit e4d00b42 authored by Jake Stine's avatar Jake Stine Committed by GitHub
Browse files

audio: use rawgeti instead of gettable (perf) (#203)

rawgeti bypasses metatable lookups (index overloading, essentially). We don't need to care about it.
Co-authored-by: Jean-Andre Santoni's avatarJean-André Santoni <jean.andre.santoni@gmail.com>
parent 032307b1
Pipeline #22517 passed with stages
in 4 minutes and 8 seconds
......@@ -36,10 +36,9 @@ audio_Source* getSourcePtrFromRef(lua_State* L, audioSourceByRef ref)
return NULL;
lua_getglobal(L, "refs_audio_playing");
lua_pushinteger(L, ref.lua_ref);
lua_gettable(L, -2);
lua_rawgeti(L, -1, ref.lua_ref);
audio_Source* result = lua_touserdata(L, -1);
return result;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment