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:
arseny.kapoulkine 2009-10-11 08:40:11 +00:00
parent 29e42bb25f
commit f3ef88386c

View file

@ -2588,7 +2588,7 @@ namespace pugi
bool xml_node::traverse(xml_tree_walker& walker)
{
walker._depth = 0;
walker._depth = -1;
if (!walker.begin(*this)) return false;
@ -2596,6 +2596,8 @@ namespace pugi
if (cur)
{
++walker._depth;
do
{
if (!walker.for_each(cur))