MCPcopy Create free account
hub / github.com/chromium/crashpad / RemoveKey

Method RemoveKey

client/simple_string_dictionary.h:222–237  ·  view source on GitHub ↗

\brief Removes \a key from the map. If \a key is not found, this is a no-op. \param[in] key The key of the entry to remove. This must not be `nullptr`, nor an empty string. It must not contain embedded `NUL`s.

Source from the content-addressed store, hash-verified

220 //! \param[in] key The key of the entry to remove. This must not be `nullptr`,
221 //! nor an empty string. It must not contain embedded `NUL`s.
222 void RemoveKey(std::string_view key) {
223 DCHECK(key.data());
224 DCHECK(key.size());
225 DCHECK_EQ(key.find('\0', 0), std::string_view::npos);
226 if (!key.data() || !key.size()) {
227 return;
228 }
229
230 Entry* entry = GetEntryForKey(key);
231 if (entry) {
232 entry->key[0] = '\0';
233 entry->value[0] = '\0';
234 }
235
236 DCHECK_EQ(GetEntryForKey(key), implicit_cast<Entry*>(nullptr));
237 }
238
239 private:
240 static void SetFromStringView(std::string_view src,

Callers 1

TESTFunction · 0.80

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.64