MCPcopy Create free account
hub / github.com/DFHack/dfhack / trim

Method trim

plugins/spectate.cpp:268–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 }
267
268 void trim() {
269 uint32_t unpaused_ms = Core::getInstance().getUnpausedMs();
270 if (unpaused_ms < RECENT_UNIT_MS)
271 return;
272 uint32_t cutoff = unpaused_ms - RECENT_UNIT_MS;
273 for (auto it = units.begin(); it != units.end();) {
274 if (it->second < cutoff)
275 it = units.erase(it);
276 else
277 ++it;
278 }
279 }
280} recent_units;
281
282static void on_new_active_unit(color_ostream& out, void* data) {

Callers 1

Calls 3

beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected