MCPcopy Create free account
hub / github.com/Snapchat/Valdi / all

Method all

valdi_core/src/valdi_core/cpp/Utils/StringCache.cpp:111–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111std::vector<StringBox> StringCache::all() const {
112 std::vector<StringBox> out;
113
114 std::lock_guard<Mutex> guard(_mutex);
115 out.reserve(_table.size());
116
117 for (const auto& it : _table) {
118 auto locked = it.impl->lock();
119 if (locked != nullptr) {
120 out.emplace_back(Ref<InternedStringImpl>(std::move(locked)));
121 }
122 }
123
124 return out;
125}
126
127StringCache::StringTable::const_iterator StringCache::findEntry(const std::string_view& str, size_t hash) const {
128 return _table.find(str, makePHMapHash(hash));

Callers

nothing calls this directly

Calls 3

reserveMethod · 0.45
sizeMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected