summaryrefslogtreecommitdiff
path: root/indra/llxml
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2020-05-06 16:06:26 -0400
committerNat Goodspeed <nat@lindenlab.com>2020-05-06 16:06:26 -0400
commitca6f09292925a7bd936338cb598efb3ddc8524bf (patch)
tree3f27e75fc8443b84e91fcac400084fd83dfed26a /indra/llxml
parent4768d092f611576b4e4e95574e9b16192e7ced5e (diff)
parent4a7fd0117a43dca9e30c58c6417ebdf6862561f6 (diff)
DRTVWR-476: Merge branch 'master' of lindenlab/viewer into DRTVWR-476-boost-1.72
Diffstat (limited to 'indra/llxml')
-rw-r--r--indra/llxml/llxmltree.cpp16
-rw-r--r--indra/llxml/llxmltree.h8
2 files changed, 13 insertions, 11 deletions
diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp
index ca98953f92..ed9c07e1db 100644
--- a/indra/llxml/llxmltree.cpp
+++ b/indra/llxml/llxmltree.cpp
@@ -111,9 +111,11 @@ LLXmlTreeNode::~LLXmlTreeNode()
attribute_map_t::iterator iter;
for (iter=mAttributes.begin(); iter != mAttributes.end(); iter++)
delete iter->second;
- child_list_t::iterator child_iter;
- for (child_iter=mChildList.begin(); child_iter != mChildList.end(); child_iter++)
- delete *child_iter;
+ for(LLXmlTreeNode* node : mChildren)
+ {
+ delete node;
+ }
+ mChildren.clear();
}
void LLXmlTreeNode::dump( const std::string& prefix )
@@ -149,15 +151,15 @@ void LLXmlTreeNode::addAttribute(const std::string& name, const std::string& val
LLXmlTreeNode* LLXmlTreeNode::getFirstChild()
{
- mChildListIter = mChildList.begin();
+ mChildrenIter = mChildren.begin();
return getNextChild();
}
LLXmlTreeNode* LLXmlTreeNode::getNextChild()
{
- if (mChildListIter == mChildList.end())
+ if (mChildrenIter == mChildren.end())
return 0;
else
- return *mChildListIter++;
+ return *mChildrenIter++;
}
LLXmlTreeNode* LLXmlTreeNode::getChildByName(const std::string& name)
@@ -184,7 +186,7 @@ void LLXmlTreeNode::appendContents(const std::string& str)
void LLXmlTreeNode::addChild(LLXmlTreeNode* child)
{
llassert( child );
- mChildList.push_back( child );
+ mChildren.push_back( child );
// Add a name mapping to this node
LLStdStringHandle tableptr = mTree->mNodeNames.insert(child->mName);
diff --git a/indra/llxml/llxmltree.h b/indra/llxml/llxmltree.h
index a82fee0416..3e425c3870 100644
--- a/indra/llxml/llxmltree.h
+++ b/indra/llxml/llxmltree.h
@@ -151,7 +151,7 @@ public:
LLXmlTreeNode* getParent() { return mParent; }
LLXmlTreeNode* getFirstChild();
LLXmlTreeNode* getNextChild();
- S32 getChildCount() { return (S32)mChildList.size(); }
+ S32 getChildCount() { return (S32)mChildren.size(); }
LLXmlTreeNode* getChildByName( const std::string& name ); // returns first child with name, NULL if none
LLXmlTreeNode* getNextNamedChild(); // returns next child with name, NULL if none
@@ -177,9 +177,9 @@ private:
std::string mName;
std::string mContents;
- typedef std::list<class LLXmlTreeNode *> child_list_t;
- child_list_t mChildList;
- child_list_t::iterator mChildListIter;
+ typedef std::vector<class LLXmlTreeNode *> children_t;
+ children_t mChildren;
+ children_t::iterator mChildrenIter;
typedef std::multimap<LLStdStringHandle, LLXmlTreeNode *> child_map_t;
child_map_t mChildMap; // for fast name lookups