| 245 | } |
| 246 | |
| 247 | bool 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 | |
| 272 | void node_data::reset_sequence() { |
| 273 | m_sequence.clear(); |