From c3f4423e98f6fa506dfd163c2b53a1404476e93f Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sat, 29 May 2010 09:02:33 +0000 Subject: Very minor XPath refactoring git-svn-id: http://pugixml.googlecode.com/svn/trunk@459 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixpath.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pugixpath.cpp') diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp index 7a47349..9562ca1 100644 --- a/src/pugixpath.cpp +++ b/src/pugixpath.cpp @@ -1422,7 +1422,7 @@ namespace pugi xpath_context c; c.root = context.root; - size_t i = 0; + size_t i = 1; size_t size = ns.size() - first; xpath_node_set::iterator last = ns.mut_begin() + first; @@ -1431,12 +1431,12 @@ namespace pugi for (xpath_node_set::iterator it = last; it != ns.end(); ++it, ++i) { c.n = *it; - c.position = i + 1; + c.position = i; c.size = size; if (expr->rettype() == xpath_type_number) { - if (expr->eval_number(c) == i + 1) + if (expr->eval_number(c) == i) *last++ = *it; } else if (expr->eval_boolean(c)) -- cgit v1.2.3