xml_node::find_node is now not recursive
git-svn-id: http://pugixml.googlecode.com/svn/trunk@614 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
93bb5dcb43
commit
546a0f7561
@ -1343,15 +1343,19 @@ namespace pugi
|
|||||||
{
|
{
|
||||||
if (!_root) return xml_node();
|
if (!_root) return xml_node();
|
||||||
|
|
||||||
for (xml_node node = first_child(); node; node = node.next_sibling())
|
xml_node cur = first_child();
|
||||||
{
|
|
||||||
if (pred(node))
|
|
||||||
return node;
|
|
||||||
|
|
||||||
if (node.first_child())
|
while (cur._root && cur._root != _root)
|
||||||
{
|
{
|
||||||
xml_node found = node.find_node(pred);
|
if (pred(cur)) return cur;
|
||||||
if (found) return found;
|
|
||||||
|
if (cur.first_child()) cur = cur.first_child();
|
||||||
|
else if (cur.next_sibling()) cur = cur.next_sibling();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (!cur.next_sibling() && cur._root != _root) cur = cur.parent();
|
||||||
|
|
||||||
|
if (cur._root != _root) cur = cur.next_sibling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user