MCPcopy Create free account
hub / github.com/BanjoRecomp/BanjoRecomp / get

Method get

src/game/recomp_data_api.cpp:20–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 std::unordered_map<KeyType, ValueType> map{};
19public:
20 bool get(const KeyType& key, ValueType& out) {
21 std::lock_guard lock{mutex};
22 auto find_it = map.find(key);
23 if (find_it == map.end()) {
24 return false;
25 }
26 out = find_it->second;
27 return true;
28 }
29
30 bool insert(const KeyType& key, ValueType val) {
31 std::lock_guard lock{mutex};

Calls 1

endMethod · 0.45

Tested by

no test coverage detected