MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / mainposition

Function mainposition

Source/Misc/lua/src/lua.c:9340–9353  ·  view source on GitHub ↗

** returns the `main' position of an element in a table (that is, the index ** of its hash value) */

Source from the content-addressed store, hash-verified

9338** of its hash value)
9339*/
9340static Node *mainposition (const Table *t, const TValue *key) {
9341switch (ttype(key)) {
9342case LUA_TNUMBER:
9343return hashnum(t, nvalue(key));
9344case LUA_TSTRING:
9345return hashstr(t, rawtsvalue(key));
9346case LUA_TBOOLEAN:
9347return hashboolean(t, bvalue(key));
9348case LUA_TLIGHTUSERDATA:
9349return hashpointer(t, pvalue(key));
9350default:
9351return hashpointer(t, gcvalue(key));
9352}
9353}
9354
9355
9356/*

Callers 4

findindexFunction · 0.85
newkeyFunction · 0.85
luaH_getFunction · 0.85
luaH_mainpositionFunction · 0.85

Calls 1

hashnumFunction · 0.85

Tested by

no test coverage detected