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

Method GetValueForKey

client/simple_string_dictionary.h:136–150  ·  view source on GitHub ↗

\brief Given \a key, returns its corresponding value. \param[in] key The key to look up. This must not be `nullptr`, nor an empty string. It must not contain embedded `NUL`s. \return The corresponding value for \a key, or if \a key is not found, `nullptr`.

Source from the content-addressed store, hash-verified

134 //! \return The corresponding value for \a key, or if \a key is not found,
135 //! `nullptr`.
136 const char* GetValueForKey(std::string_view key) const {
137 DCHECK(key.data());
138 DCHECK(key.size());
139 DCHECK_EQ(key.find('\0', 0), std::string_view::npos);
140 if (!key.data() || !key.size()) {
141 return nullptr;
142 }
143
144 const Entry* entry = GetConstEntryForKey(key);
145 if (!entry) {
146 return nullptr;
147 }
148
149 return entry->value;
150 }
151
152 //! \brief Stores \a value into \a key, replacing the existing value if \a key
153 //! is already present.

Callers 2

TESTFunction · 0.80
ExpectSimpleMapFunction · 0.80

Calls 2

dataMethod · 0.45
sizeMethod · 0.45

Tested by 2

TESTFunction · 0.64
ExpectSimpleMapFunction · 0.64