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

Method RemoveIfOverflown

library/cpp/cache/cache.h:101–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 }
100
101 TItem* RemoveIfOverflown() {
102 TItem* deleted = nullptr;
103 if (TotalSize > MaxSize && ItemsAmount > 1) {
104 deleted = GetOldest();
105 Erase(deleted);
106 }
107 return deleted;
108 }
109
110 TItem* GetOldest() {
111 typename TListType::TIterator it = List.Begin();

Callers

nothing calls this directly

Calls 1

EraseFunction · 0.85

Tested by

no test coverage detected