Update ConfigProcessor.cpp

This commit is contained in:
Alexey Milovidov 2022-11-26 00:09:33 +03:00 committed by GitHub
parent 38ecdc0627
commit f9c3de5aa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,8 @@ void ConfigProcessor::mergeRecursive(XMLDocumentPtr config, Node * config_root,
node = next_node; node = next_node;
} }
for (Node * with_node = with_nodes->item(0), * next_with_node = nullptr; with_node; with_node = next_with_node) Node * next_with_node = nullptr;
for (Node * with_node = with_nodes->item(0); with_node; with_node = next_with_node)
{ {
next_with_node = with_node->nextSibling(); next_with_node = with_node->nextSibling();
bool merged = false; bool merged = false;
@ -337,7 +338,8 @@ void ConfigProcessor::doIncludesRecursive(
if (node->nodeName() == "include") if (node->nodeName() == "include")
{ {
const NodeListPtr children = node_to_include->childNodes(); const NodeListPtr children = node_to_include->childNodes();
for (Node * child = children->item(0), * next_child = nullptr; child; child = next_child) Node * next_child = nullptr;
for (Node * child = children->item(0); child; child = next_child)
{ {
next_child = child->nextSibling(); next_child = child->nextSibling();
NodePtr new_node = config->importNode(child, true); NodePtr new_node = config->importNode(child, true);
@ -362,7 +364,8 @@ void ConfigProcessor::doIncludesRecursive(
} }
const NodeListPtr children = node_to_include->childNodes(); const NodeListPtr children = node_to_include->childNodes();
for (Node * child = children->item(0), * next_child = nullptr; child; child = next_child) Node * next_child = nullptr;
for (Node * child = children->item(0); child; child = next_child)
{ {
next_child = child->nextSibling(); next_child = child->nextSibling();
NodePtr new_node = config->importNode(child, true); NodePtr new_node = config->importNode(child, true);
@ -370,7 +373,8 @@ void ConfigProcessor::doIncludesRecursive(
} }
const NamedNodeMapPtr from_attrs = node_to_include->attributes(); const NamedNodeMapPtr from_attrs = node_to_include->attributes();
for (Node * attr = from_attrs->item(0), * next_attr = nullptr; attr; attr = next_attr) Node * next_attr = nullptr;
for (Node * attr = from_attrs->item(0); attr; attr = next_attr)
{ {
next_attr = attr->nextSibling(); next_attr = attr->nextSibling();
element.setAttributeNode(dynamic_cast<Attr *>(config->importNode(attr, true))); element.setAttributeNode(dynamic_cast<Attr *>(config->importNode(attr, true)));
@ -435,7 +439,8 @@ void ConfigProcessor::doIncludesRecursive(
else else
{ {
NodeListPtr children = node->childNodes(); NodeListPtr children = node->childNodes();
for (Node * child = children->item(0), * next_child = nullptr; child; child = next_child) Node * next_child = nullptr;
for (Node * child = children->item(0); child; child = next_child)
{ {
next_child = child->nextSibling(); next_child = child->nextSibling();
doIncludesRecursive(config, include_from, child, zk_node_cache, zk_changed_event, contributing_zk_paths); doIncludesRecursive(config, include_from, child, zk_node_cache, zk_changed_event, contributing_zk_paths);