traverse now sets depth to -1 for both begin() and end()
git-svn-id: http://pugixml.googlecode.com/svn/trunk@146 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
29e42bb25f
commit
f3ef88386c
@ -2588,7 +2588,7 @@ namespace pugi
|
|||||||
|
|
||||||
bool xml_node::traverse(xml_tree_walker& walker)
|
bool xml_node::traverse(xml_tree_walker& walker)
|
||||||
{
|
{
|
||||||
walker._depth = 0;
|
walker._depth = -1;
|
||||||
|
|
||||||
if (!walker.begin(*this)) return false;
|
if (!walker.begin(*this)) return false;
|
||||||
|
|
||||||
@ -2596,6 +2596,8 @@ namespace pugi
|
|||||||
|
|
||||||
if (cur)
|
if (cur)
|
||||||
{
|
{
|
||||||
|
++walker._depth;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (!walker.for_each(cur))
|
if (!walker.for_each(cur))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user