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

Method remove

lib/yamlcpp/src/node_data.cpp:247–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247bool node_data::remove(node& key, const shared_memory_holder& /* pMemory */) {
248 if (m_type != NodeType::Map)
249 return false;
250
251 for (auto it = m_undefinedPairs.begin(); it != m_undefinedPairs.end();) {
252 auto jt = std::next(it);
253 if (it->first->is(key))
254 m_undefinedPairs.erase(it);
255 it = jt;
256 }
257
258 auto it =
259 std::find_if(m_map.begin(), m_map.end(),
260 [&](std::pair<YAML::detail::node*, YAML::detail::node*> j) {
261 return (j.first->is(key));
262 });
263
264 if (it != m_map.end()) {
265 m_map.erase(it);
266 return true;
267 }
268
269 return false;
270}
271
272void node_data::reset_sequence() {
273 m_sequence.clear();

Callers 1

TESTFunction · 0.45

Calls 4

beginMethod · 0.45
endMethod · 0.45
isMethod · 0.45
eraseMethod · 0.45

Tested by 1

TESTFunction · 0.36