MCPcopy Create free account
hub / github.com/facebook/CacheLib / findImpl

Method findImpl

cachelib/interface/tests/InterfaceTest.cpp:131–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129
130 template <typename HandleT>
131 Result<std::optional<HandleT>> findImpl(Key key) {
132 auto it = cachedItems_.find(key);
133 if (it != cachedItems_.end()) {
134 auto result = tryCreateHandle<HandleT>(*this, *it->second);
135 if (result.hasError()) {
136 return folly::makeUnexpected(std::move(result).error());
137 }
138 return std::move(result).value();
139 }
140 return std::nullopt;
141 }
142
143 folly::coro::Task<Result<std::optional<ReadHandle>>> find(Key key) override {
144 co_return findImpl<ReadHandle>(key);

Callers

nothing calls this directly

Calls 3

findMethod · 0.45
endMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected