1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a method XmlElement::prependChildElement(), and used this for a few optimisations.

This commit is contained in:
jules 2013-10-25 12:52:19 +01:00
parent 6ff9512059
commit 61ed92ee51
5 changed files with 45 additions and 7 deletions

View file

@ -412,8 +412,9 @@ public:
XmlElement* const xml = new XmlElement (type.toString());
properties.copyToXmlAttributes (*xml);
for (int i = 0; i < children.size(); ++i)
xml->addChildElement (children.getObjectPointerUnchecked(i)->createXml());
// (NB: it's faster to add nodes to XML elements in reverse order)
for (int i = children.size(); --i >= 0;)
xml->prependChildElement (children.getObjectPointerUnchecked(i)->createXml());
return xml;
}