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

Method Insert

library/cpp/cache/cache.h:373–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371
372public:
373 TItem* Insert(TItem* item) {
374 FixHeap();
375
376 if (Size >= MaxSize && item->Weight < GetLightest()->Weight) {
377 return item;
378 }
379
380 Heap.push_back(item);
381 PushHeap(Heap.begin(), Heap.end(), THeapComparator());
382 ++Size;
383
384 return RemoveIfOverflown();
385 }
386
387 TItem* RemoveIfOverflown() {
388 if (Size <= MaxSize) {

Callers

nothing calls this directly

Calls 5

PushHeapFunction · 0.85
THeapComparatorClass · 0.85
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected