summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-29 09:02:33 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-29 09:02:33 +0000
commitc3f4423e98f6fa506dfd163c2b53a1404476e93f (patch)
treede84935a3cc60f3567fa9eea84620c4cdf2fdf96
parentff19e9475a90d44961b02717ca57c07f44b0003c (diff)
Very minor XPath refactoring
git-svn-id: http://pugixml.googlecode.com/svn/trunk@459 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--src/pugixpath.cpp6
1 files changed, 3 insertions, 3 deletions
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))