From 36b3cd8a76bc86a09757e894462e4c6dfbbf91be Mon Sep 17 00:00:00 2001 From: Jez Higgins Date: Wed, 15 Apr 2020 23:20:50 +0100 Subject: [PATCH] Replace auto_ptr with unique_ptr in XPath compiler --- include/XPath/impl/xpath_step.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/XPath/impl/xpath_step.hpp b/include/XPath/impl/xpath_step.hpp index 5550e0e9..3d35a7aa 100644 --- a/include/XPath/impl/xpath_step.hpp +++ b/include/XPath/impl/xpath_step.hpp @@ -219,8 +219,8 @@ public: Axis axis, bool is_attr = false) { - std::auto_ptr > test(getTest(node, end, !is_attr ? axis : ATTRIBUTE, context.namespaceContext())); - std::auto_ptr > thing; + std::unique_ptr > test(getTest(node, end, !is_attr ? axis : ATTRIBUTE, context.namespaceContext())); + std::unique_ptr > thing; if(test.get() == 0) thing.reset(XPath::compile_expression(node++, end, context)); @@ -489,14 +489,14 @@ public: const ExecutionContext& executionContext) const { NodeSet ns; - - NodeSet nodes = expr_->evaluate(context, executionContext).asNodeSet(); - for(typename NodeSet::const_iterator n = nodes.begin(), ne = nodes.end(); n != ne; ++n) - if(context == *n) - { - ns.push_back(context); - break; - } // if ... + + NodeSet nodes = expr_->evaluate(context, executionContext).asNodeSet(); + for(typename NodeSet::const_iterator n = nodes.begin(), ne = nodes.end(); n != ne; ++n) + if(context == *n) + { + ns.push_back(context); + break; + } // if ... return XPathValue(new NodeSetValue(ns)); } // evaluate