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

Method insertString

valdi_core/src/valdi_core/cpp/Utils/StringCache.cpp:90–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90StringBox StringCache::insertString(std::string_view str, size_t hash) {
91 auto internedString = InternedStringImpl::make(str.data(), str.size(), hash);
92
93 _table.emplace(internedString.get());
94
95 return StringBox(Ref<InternedStringImpl>(std::move(internedString)));
96}
97
98void StringCache::removeString(const InternedStringImpl* internedString) {
99 std::lock_guard<Mutex> guard(_mutex);

Callers

nothing calls this directly

Calls 5

StringBoxClass · 0.70
getMethod · 0.65
dataMethod · 0.45
sizeMethod · 0.45
emplaceMethod · 0.45

Tested by

no test coverage detected