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

Method InvalidateCache

src/cargopacket.cpp:205–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203/** Invalidates the cached data and rebuilds it. */
204template <class Tinst, class Tcont>
205void CargoList<Tinst, Tcont>::InvalidateCache()
206{
207 this->count = 0;
208 this->cargo_periods_in_transit = 0;
209
210 for (ConstIterator it(this->packets.begin()); it != this->packets.end(); it++) {
211 static_cast<Tinst *>(this)->AddToCache(*it);
212 }
213}
214
215/**
216 * Tries to merge the second packet into the first and return if that was

Callers 2

CheckCachesFunction · 0.80
AfterLoadMethod · 0.80

Calls 3

AddToCacheMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected