MCPcopy Create free account
hub / github.com/Tencent/UnLua / make_assoc

Function make_assoc

Plugins/UnLuaExtensions/LuaSocket/Source/src/select.cpp:196–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196static void make_assoc(lua_State *L, int tab) {
197 int i = 1, atab;
198 lua_newtable(L); atab = lua_gettop(L);
199 for ( ;; ) {
200 lua_pushnumber(L, i);
201 lua_gettable(L, tab);
202 if (!lua_isnil(L, -1)) {
203 lua_pushnumber(L, i);
204 lua_pushvalue(L, -2);
205 lua_settable(L, atab);
206 lua_pushnumber(L, i);
207 lua_settable(L, atab);
208 } else {
209 lua_pop(L, 1);
210 break;
211 }
212 i = i+1;
213 }
214}

Callers 1

global_selectFunction · 0.85

Calls 5

lua_gettopFunction · 0.85
lua_pushnumberFunction · 0.85
lua_gettableFunction · 0.85
lua_pushvalueFunction · 0.85
lua_settableFunction · 0.85

Tested by

no test coverage detected