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

Method FindPointer

src/leveldb/util/cache.cc:114–120  ·  view source on GitHub ↗

Return a pointer to slot that points to a cache entry that matches key/hash. If there is no such cache entry, return a pointer to the trailing slot in the corresponding linked list.

Source from the content-addressed store, hash-verified

112 // matches key/hash. If there is no such cache entry, return a
113 // pointer to the trailing slot in the corresponding linked list.
114 LRUHandle** FindPointer(const Slice& key, uint32_t hash) {
115 LRUHandle** ptr = &list_[hash & (length_ - 1)];
116 while (*ptr != nullptr && ((*ptr)->hash != hash || key != (*ptr)->key())) {
117 ptr = &(*ptr)->next_hash;
118 }
119 return ptr;
120 }
121
122 void Resize() {
123 uint32_t new_length = 4;

Callers

nothing calls this directly

Calls 1

keyMethod · 0.45

Tested by

no test coverage detected