diff options
author | B. Stack <bgstack15@gmail.com> | 2023-07-24 15:08:16 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-07-24 15:08:16 -0400 |
commit | 69e12f5bd10459ff7c239b82519107ae2a755bc0 (patch) | |
tree | 8b22393241df7e46686c9426140582bd747a6d5a /zenXml/zenxml/parser.h | |
parent | add upstream 12.4 (diff) | |
download | FreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.tar.gz FreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.tar.bz2 FreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.zip |
add upstream 12.5
Diffstat (limited to 'zenXml/zenxml/parser.h')
-rw-r--r-- | zenXml/zenxml/parser.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/zenXml/zenxml/parser.h b/zenXml/zenxml/parser.h index 8416c211..e089a86f 100644 --- a/zenXml/zenxml/parser.h +++ b/zenXml/zenxml/parser.h @@ -206,14 +206,14 @@ void serialize(const XmlElement& element, std::string& stream, for (auto it = attr.first; it != attr.second; ++it) stream += ' ' + normalizeName(it->name) + "=\"" + normalizeAttribValue(it->value) + '"'; - auto itPair = element.getChildren(); - if (itPair.first != itPair.second) //structured element + auto [it, itEnd] = element.getChildren(); + if (it != itEnd) //structured element { //no support for mixed-mode content stream += '>' + lineBreak; - std::for_each(itPair.first, itPair.second, - [&](const XmlElement& el) { serialize(el, stream, lineBreak, indent, indentLevel + 1); }); + std::for_each(it, itEnd, [&](const XmlElement& el) + { serialize(el, stream, lineBreak, indent, indentLevel + 1); }); for (size_t i = 0; i < indentLevel; ++i) stream += indent; @@ -483,9 +483,9 @@ public: XmlElement dummy; parseChildElements(dummy); - auto itPair = dummy.getChildren(); - if (itPair.first != itPair.second) - doc.root().swapSubtree(*itPair.first); + auto [it, itEnd] = dummy.getChildren(); + if (it != itEnd) + doc.root().swapSubtree(*it); expectToken(Token::TK_END); //throw XmlParsingError return doc; |