| 10061 | } |
| 10062 | |
| 10063 | inline void clear(lua_State* L, int table_index) { |
| 10064 | lua_pushnil(L); |
| 10065 | while (lua_next(L, table_index) != 0) { |
| 10066 | // remove value |
| 10067 | lua_pop(L, 1); |
| 10068 | // duplicate key to protect form rawset |
| 10069 | lua_pushvalue(L, -1); |
| 10070 | // push new value |
| 10071 | lua_pushnil(L); |
| 10072 | // table_index%[key] = nil |
| 10073 | lua_rawset(L, table_index); |
| 10074 | } |
| 10075 | } |
| 10076 | |
| 10077 | inline void clear(reference& r) { |
| 10078 | auto pp = push_pop<false>(r); |
no test coverage detected