MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / KeepValue

Method KeepValue

src/script/api/script_list.cpp:716–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714}
715
716void ScriptList::KeepValue(SQInteger value)
717{
718 this->modifications++;
719
720 for (ScriptListMap::iterator next_iter, iter = this->items.begin(); iter != this->items.end(); iter = next_iter) {
721 next_iter = std::next(iter);
722 if (iter->second != value) this->RemoveItem(iter->first);
723 }
724}
725
726void ScriptList::KeepTop(SQInteger count)
727{

Callers

nothing calls this directly

Calls 3

RemoveItemMethod · 0.95
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected