summaryrefslogtreecommitdiff
path: root/indra/llxuixml/llxuiparser.cpp
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-10-11 09:10:33 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-10-11 09:10:33 -0700
commit05b31ff3b235bdcf7e9bb0fe1ff701c006e8ec66 (patch)
tree4fd5e083694142609bd099cf71e092f9c7457e9f /indra/llxuixml/llxuiparser.cpp
parent0620e6a79149e455744131703e8bdb74864b69be (diff)
parentc845925eebb5cad3049ee0f3b1d0adea3e3a46b5 (diff)
Merge
Diffstat (limited to 'indra/llxuixml/llxuiparser.cpp')
-rw-r--r--indra/llxuixml/llxuiparser.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 1bb550d98f..aee8fa8d8f 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -729,22 +729,11 @@ void LLXUIParser::writeXUI(LLXMLNodePtr node, const LLInitParam::BaseBlock &bloc
// go from a stack of names to a specific XML node
LLXMLNodePtr LLXUIParser::getNode(name_stack_t& stack)
{
- name_stack_t name_stack;
- for (name_stack_t::const_iterator it = stack.begin();
- it != stack.end();
- ++it)
- {
- if (!it->first.empty())
- {
- name_stack.push_back(*it);
- }
- }
-
LLXMLNodePtr out_node = mWriteRootNode;
- name_stack_t::const_iterator next_it = name_stack.begin();
- for (name_stack_t::const_iterator it = name_stack.begin();
- it != name_stack.end();
+ name_stack_t::iterator next_it = stack.begin();
+ for (name_stack_t::iterator it = stack.begin();
+ it != stack.end();
it = next_it)
{
++next_it;
@@ -753,17 +742,18 @@ LLXMLNodePtr LLXUIParser::getNode(name_stack_t& stack)
continue;
}
- out_nodes_t::iterator found_it = mOutNodes.lower_bound(it->second);
+ out_nodes_t::iterator found_it = mOutNodes.find(it->first);
// node with this name not yet written
- if (found_it == mOutNodes.end() || mOutNodes.key_comp()(found_it->first, it->second))
+ if (found_it == mOutNodes.end() || it->second)
{
// make an attribute if we are the last element on the name stack
- bool is_attribute = next_it == name_stack.end();
+ bool is_attribute = next_it == stack.end();
LLXMLNodePtr new_node = new LLXMLNode(it->first.c_str(), is_attribute);
out_node->addChild(new_node);
- mOutNodes.insert(found_it, std::make_pair(it->second, new_node));
+ mOutNodes[it->first] = new_node;
out_node = new_node;
+ it->second = false;
}
else
{