XPath: Split optimize into optimize and optimize_self
This makes the code slightly more readable, but more importantly it fixes a false positive in Clang static analyzer. Fixes #47.
This commit is contained in:
parent
d4fedd6775
commit
4460da54a1
@ -10660,6 +10660,11 @@ PUGI__NS_BEGIN
|
|||||||
if (_right) _right->optimize(alloc);
|
if (_right) _right->optimize(alloc);
|
||||||
if (_next) _next->optimize(alloc);
|
if (_next) _next->optimize(alloc);
|
||||||
|
|
||||||
|
optimize_self(alloc);
|
||||||
|
}
|
||||||
|
|
||||||
|
void optimize_self(xpath_allocator* alloc)
|
||||||
|
{
|
||||||
// Rewrite [position()=expr] with [expr]
|
// Rewrite [position()=expr] with [expr]
|
||||||
// Note that this step has to go before classification to recognize [position()=1]
|
// Note that this step has to go before classification to recognize [position()=1]
|
||||||
if ((_type == ast_filter || _type == ast_predicate) &&
|
if ((_type == ast_filter || _type == ast_predicate) &&
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user