MCPcopy Create free account
hub / github.com/ElementsProject/elements / Lookup

Method Lookup

src/leveldb/util/cache_test.cc:42–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 ~CacheTest() { delete cache_; }
41
42 int Lookup(int key) {
43 Cache::Handle* handle = cache_->Lookup(EncodeKey(key));
44 const int r = (handle == nullptr) ? -1 : DecodeValue(cache_->Value(handle));
45 if (handle != nullptr) {
46 cache_->Release(handle);
47 }
48 return r;
49 }
50
51 void Insert(int key, int value, int charge = 1) {
52 cache_->Release(cache_->Insert(EncodeKey(key), EncodeValue(value), charge,

Callers 1

TESTFunction · 0.45

Calls 4

DecodeValueFunction · 0.85
EncodeKeyFunction · 0.70
ValueMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected