MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / remove

Function remove

Libs/sol/sol.hpp:8994–9018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8992
8993 namespace stack {
8994 inline void remove(lua_State* L, int rawindex, int count) {
8995 if (count < 1)
8996 return;
8997 int top = lua_gettop(L);
8998 if (top < 1) {
8999 return;
9000 }
9001 if (rawindex == -count || top == rawindex) {
9002 // Slice them right off the top
9003 lua_pop(L, static_cast<int>(count));
9004 return;
9005 }
9006
9007 // Remove each item one at a time using stack operations
9008 // Probably slower, maybe, haven't benchmarked,
9009 // but necessary
9010 int index = lua_absindex(L, rawindex);
9011 if (index < 0) {
9012 index = lua_gettop(L) + (index + 1);
9013 }
9014 int last = index + count;
9015 for (int i = index; i < last; ++i) {
9016 lua_remove(L, index);
9017 }
9018 }
9019
9020 struct push_popper_at {
9021 lua_State* L;

Callers 13

LoadLevelFileFunction · 0.85
DeleteMethod · 0.85
CleanupOldLogsFunction · 0.85
~push_popper_atMethod · 0.85
~basic_table_iteratorMethod · 0.85
~load_resultMethod · 0.85
script_throw_on_errorFunction · 0.85
parseMethod · 0.85
extractInfoMethod · 0.85
os-inl.hFile · 0.85
rename_file_Method · 0.85

Calls 1

lua_absindexFunction · 0.85

Tested by

no test coverage detected