Fixed for predicate evaluation bug

see http://www.jezuk.co.uk/cgi-bin/view/arabica/news?id=2883
This commit is contained in:
jez_higgins 2006-06-23 22:51:30 +00:00
parent 625c7141e1
commit 5caf17b989

View file

@ -118,6 +118,7 @@ private:
const ExecutionContext<string_type, string_adaptor>& parentContext) const
{
AxisEnumerator<string_type, string_adaptor> enumerator(context, axis_);
results.forward(enumerator.forward());
NodeSet<string_type> intermediate(enumerator.forward());
NodeSet<string_type>& d = (!baseT::has_predicates()) ? results : intermediate;
while(*enumerator != 0)
@ -130,14 +131,11 @@ private:
} // while ...
if(!baseT::has_predicates())
{
results.forward(enumerator.forward());
return;
} // if ...
intermediate = baseT::applyPredicates(intermediate, parentContext);
results.swap(intermediate);
results.insert(results.end(), intermediate.begin(), intermediate.end());
} // enumerateOver
Axis axis_;