summaryrefslogtreecommitdiff
path: root/zenXml/zenxml/parser.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-07-24 15:08:16 -0400
committerB. Stack <bgstack15@gmail.com>2023-07-24 15:08:16 -0400
commit69e12f5bd10459ff7c239b82519107ae2a755bc0 (patch)
tree8b22393241df7e46686c9426140582bd747a6d5a /zenXml/zenxml/parser.h
parentadd upstream 12.4 (diff)
downloadFreeFileSync-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.h14
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;
bgstack15