mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
[clang-tidy] convert to range loops (#889)
Found with modernize-loop-convert Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
@@ -209,9 +209,9 @@ node* node_data::get(node& key, shared_memory_holder /* pMemory */) const {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {
|
for (const auto& it : m_map) {
|
||||||
if (it->first->is(key))
|
if (it.first->is(key))
|
||||||
return it->second;
|
return it.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@@ -230,9 +230,9 @@ node& node_data::get(node& key, shared_memory_holder pMemory) {
|
|||||||
throw BadSubscript(m_mark, key);
|
throw BadSubscript(m_mark, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (node_map::const_iterator it = m_map.begin(); it != m_map.end(); ++it) {
|
for (const auto& it : m_map) {
|
||||||
if (it->first->is(key))
|
if (it.first->is(key))
|
||||||
return *it->second;
|
return *it.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
node& value = pMemory->create_node();
|
node& value = pMemory->create_node();
|
||||||
|
@@ -32,8 +32,8 @@ void NodeEvents::Setup(const detail::node& node) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (node.type() == NodeType::Sequence) {
|
if (node.type() == NodeType::Sequence) {
|
||||||
for (detail::const_node_iterator it = node.begin(); it != node.end(); ++it)
|
for (const auto& it : node)
|
||||||
Setup(**it);
|
Setup(*it);
|
||||||
} else if (node.type() == NodeType::Map) {
|
} else if (node.type() == NodeType::Map) {
|
||||||
for (detail::const_node_iterator it = node.begin(); it != node.end();
|
for (detail::const_node_iterator it = node.begin(); it != node.end();
|
||||||
++it) {
|
++it) {
|
||||||
@@ -77,9 +77,8 @@ void NodeEvents::Emit(const detail::node& node, EventHandler& handler,
|
|||||||
break;
|
break;
|
||||||
case NodeType::Sequence:
|
case NodeType::Sequence:
|
||||||
handler.OnSequenceStart(Mark(), node.tag(), anchor, node.style());
|
handler.OnSequenceStart(Mark(), node.tag(), anchor, node.style());
|
||||||
for (detail::const_node_iterator it = node.begin(); it != node.end();
|
for (const auto& it : node)
|
||||||
++it)
|
Emit(*it, handler, am);
|
||||||
Emit(**it, handler, am);
|
|
||||||
handler.OnSequenceEnd();
|
handler.OnSequenceEnd();
|
||||||
break;
|
break;
|
||||||
case NodeType::Map:
|
case NodeType::Map:
|
||||||
|
Reference in New Issue
Block a user