summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp')
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp
index 8e9b8a76469..32607250f11 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp
@@ -83,14 +83,14 @@ void XMLElementNode::prepend (XMLNode *child) {
if (!child)
return;
XMLTextNode *textNode1 = dynamic_cast<XMLTextNode*>(child);
- if (!textNode1 || _children.empty())
- _children.emplace_front(unique_ptr<XMLNode>(child));
- else {
- if (XMLTextNode *textNode2 = dynamic_cast<XMLTextNode*>(_children.front().get()))
+ unique_ptr<XMLNode> child_uptr(child);
+ if (textNode1 && !_children.empty()) {
+ if (XMLTextNode *textNode2 = dynamic_cast<XMLTextNode*>(_children.front().get())) {
textNode2->prepend(textNode1); // merge two consecutive text nodes
- else
- _children.emplace_front(unique_ptr<XMLNode>(child));
+ return;
+ }
}
+ _children.emplace_front(std::move(child_uptr));
}