MCPcopy Create free account
hub / github.com/apple/foundationdb / insert

Method insert

fdbrpc/AsyncFileEncrypted.actor.cpp:240–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240void AsyncFileEncrypted::RandomCache::insert(uint32_t block, const Standalone<StringRef>& value) {
241 auto [_, found] = hashMap.insert({ block, value });
242 if (found) {
243 return;
244 } else if (vec.size() < maxSize) {
245 vec.push_back(block);
246 } else {
247 auto index = evict();
248 vec[index] = block;
249 }
250}
251
252Optional<Standalone<StringRef>> AsyncFileEncrypted::RandomCache::get(uint32_t block) const {
253 auto it = hashMap.find(block);

Callers 1

readMethod · 0.45

Calls 2

sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected