]> git.sesse.net Git - xml-template/commitdiff
Microscopic optimization to the C++11 code.
authorsgunderson@bigfoot.com <>
Thu, 22 Sep 2011 21:51:02 +0000 (23:51 +0200)
committersgunderson@bigfoot.com <>
Thu, 22 Sep 2011 21:51:02 +0000 (23:51 +0200)
c++11/xml-template.cpp

index 2e8fb9429fa3ab4508f33dcd4cd106ac75c39f52..61d567fdacca1cf7d4a5ae1cd35951858bb316af 100644 (file)
@@ -190,9 +190,8 @@ void Substitute::process(xmlNode *node, bool clean)
                        }
 
                        // Check all substitutions to see if we found anything appropriate.
+                       string tag = reinterpret_cast<const char *>(child->name);
                        for (auto it : substitution_map) {
-                               string tag = reinterpret_cast<const char *>(child->name);
-
                                // Attribute substitution.
                                if (begins_with(it.first, tag + "/")) {
                                        const xmlChar *attr_key = reinterpret_cast<const xmlChar *>(