| 10630 | } |
| 10631 | |
| 10632 | inline void clear(lua_State* L, int table_index) { |
| 10633 | lua_pushnil(L); |
| 10634 | while (lua_next(L, table_index) != 0) { |
| 10635 | // remove value |
| 10636 | lua_pop(L, 1); |
| 10637 | // duplicate key to protect form rawset |
| 10638 | lua_pushvalue(L, -1); |
| 10639 | // push new value |
| 10640 | lua_pushnil(L); |
| 10641 | // table_index%[key] = nil |
| 10642 | lua_rawset(L, table_index); |
| 10643 | } |
| 10644 | } |
| 10645 | |
| 10646 | inline void clear(reference& r) { |
| 10647 | auto pp = push_pop<false>(r); |
no test coverage detected