MCPcopy Create free account
hub / github.com/apache/trafficserver / remove

Method remove

lib/yamlcpp/include/yaml-cpp/node/detail/impl.h:175–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173
174template <typename Key>
175inline bool node_data::remove(const Key& key, shared_memory_holder pMemory) {
176 if (m_type == NodeType::Sequence) {
177 return remove_idx<Key>::remove(m_sequence, key, m_seqSize);
178 }
179
180 if (m_type == NodeType::Map) {
181 kv_pairs::iterator it = m_undefinedPairs.begin();
182 while (it != m_undefinedPairs.end()) {
183 kv_pairs::iterator jt = std::next(it);
184 if (it->first->equals(key, pMemory)) {
185 m_undefinedPairs.erase(it);
186 }
187 it = jt;
188 }
189
190 auto iter = std::find_if(m_map.begin(), m_map.end(), [&](const kv_pair m) {
191 return m.first->equals(key, pMemory);
192 });
193
194 if (iter != m_map.end()) {
195 m_map.erase(iter);
196 return true;
197 }
198 }
199
200 return false;
201}
202
203// map
204template <typename Key, typename Value>

Callers

nothing calls this directly

Calls 5

removeFunction · 0.85
equalsMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected