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:
parent
6ff9512059
commit
61ed92ee51
5 changed files with 45 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue