From 4460da54a17e8403f47a2cc152e72bc209dde264 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 22 Jul 2015 21:06:39 -0700 Subject: 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. --- src/pugixml.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 0d762a7..20d8ca7 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -10660,6 +10660,11 @@ PUGI__NS_BEGIN if (_right) _right->optimize(alloc); if (_next) _next->optimize(alloc); + optimize_self(alloc); + } + + void optimize_self(xpath_allocator* alloc) + { // Rewrite [position()=expr] with [expr] // Note that this step has to go before classification to recognize [position()=1] if ((_type == ast_filter || _type == ast_predicate) && -- cgit v1.2.3