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

Method PickOut

library/cpp/cache/cache.h:558–568  ·  view source on GitHub ↗

note: it shouldn't touch 'value' if it returns false.

Source from the content-addressed store, hash-verified

556
557 // note: it shouldn't touch 'value' if it returns false.
558 bool PickOut(const TKey& key, TValue* value) {
559 Y_ASSERT(value);
560 TIndexIterator it = Index.find(key);
561 if (it == Index.end())
562 return false;
563 *value = std::move(it->Value);
564 List.Erase(const_cast<TItem*>(&*it));
565 Index.erase(it);
566 Y_ASSERT(Index.size() == List.GetSize());
567 return true;
568 }
569
570 bool Insert(const std::pair<TKey, TValue>& p) {
571 return Insert(p.first, p.second);

Callers

nothing calls this directly

Calls 7

moveFunction · 0.50
findMethod · 0.45
endMethod · 0.45
EraseMethod · 0.45
eraseMethod · 0.45
sizeMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected