MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaT_gettm

Function luaT_gettm

depends/lua/src/ltm.c:59–67  ·  view source on GitHub ↗

** function to be used with macro "fasttm": optimized for absence of ** tag methods */

Source from the content-addressed store, hash-verified

57** tag methods
58*/
59const TValue *luaT_gettm (Table *events, TMS event, TString *ename) {
60 const TValue *tm = luaH_getshortstr(events, ename);
61 lua_assert(event <= TM_EQ);
62 if (ttisnil(tm)) { /* no tag method? */
63 events->flags |= cast_byte(1u<<event); /* cache this fact */
64 return NULL;
65 }
66 else return tm;
67}
68
69
70const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) {

Callers

nothing calls this directly

Calls 1

luaH_getshortstrFunction · 0.85

Tested by

no test coverage detected