MCPcopy Create free account
hub / github.com/catboost/catboost / RemoveIfOverflown

Method RemoveIfOverflown

library/cpp/cache/cache.h:238–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236 }
237
238 TItem* RemoveIfOverflown() {
239 TItem* deleted = nullptr;
240 if (TotalSize > MaxSize && ItemsAmount > 1) {
241 deleted = GetLeastFrequentlyUsed();
242 Erase(deleted);
243 }
244 return deleted;
245 }
246
247 TItem* GetLeastFrequentlyUsed() {
248 typename TListType::TIterator it = List.Begin();

Callers

nothing calls this directly

Calls 1

EraseFunction · 0.85

Tested by

no test coverage detected