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

Method RemoveIfOverflown

library/cpp/cache/cache.h:387–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385 }
386
387 TItem* RemoveIfOverflown() {
388 if (Size <= MaxSize) {
389 return nullptr;
390 }
391
392 auto lightest = GetLightest();
393 Erase(lightest);
394 PopHeap(Heap.begin(), Heap.end(), THeapComparator());
395 return lightest;
396 }
397
398 TItem* GetLightest() {
399 FixHeap();

Callers 3

InsertImplMethod · 0.45
SetMaxSizeMethod · 0.45
Y_UNIT_TESTFunction · 0.45

Calls 5

EraseFunction · 0.85
PopHeapFunction · 0.85
THeapComparatorClass · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected