mirror of
https://github.com/jezhiggins/arabica
synced 2024-11-15 19:48:00 +01:00
Replace auto_ptr with unique_ptr in XPath compiler
This commit is contained in:
parent
6674947a12
commit
36b3cd8a76
1 changed files with 10 additions and 10 deletions
|
@ -219,8 +219,8 @@ public:
|
|||
Axis axis,
|
||||
bool is_attr = false)
|
||||
{
|
||||
std::auto_ptr<NodeTest<string_type, string_adaptor> > test(getTest(node, end, !is_attr ? axis : ATTRIBUTE, context.namespaceContext()));
|
||||
std::auto_ptr<XPathExpression_impl<string_type, string_adaptor> > thing;
|
||||
std::unique_ptr<NodeTest<string_type, string_adaptor> > test(getTest(node, end, !is_attr ? axis : ATTRIBUTE, context.namespaceContext()));
|
||||
std::unique_ptr<XPathExpression_impl<string_type, string_adaptor> > thing;
|
||||
if(test.get() == 0)
|
||||
thing.reset(XPath<string_type, string_adaptor>::compile_expression(node++, end, context));
|
||||
|
||||
|
@ -489,14 +489,14 @@ public:
|
|||
const ExecutionContext<string_type, string_adaptor>& executionContext) const
|
||||
{
|
||||
NodeSet<string_type, string_adaptor> ns;
|
||||
|
||||
NodeSet<string_type, string_adaptor> nodes = expr_->evaluate(context, executionContext).asNodeSet();
|
||||
for(typename NodeSet<string_type, string_adaptor>::const_iterator n = nodes.begin(), ne = nodes.end(); n != ne; ++n)
|
||||
if(context == *n)
|
||||
{
|
||||
ns.push_back(context);
|
||||
break;
|
||||
} // if ...
|
||||
|
||||
NodeSet<string_type, string_adaptor> nodes = expr_->evaluate(context, executionContext).asNodeSet();
|
||||
for(typename NodeSet<string_type, string_adaptor>::const_iterator n = nodes.begin(), ne = nodes.end(); n != ne; ++n)
|
||||
if(context == *n)
|
||||
{
|
||||
ns.push_back(context);
|
||||
break;
|
||||
} // if ...
|
||||
|
||||
return XPathValue<string_type, string_adaptor>(new NodeSetValue<string_type, string_adaptor>(ns));
|
||||
} // evaluate
|
||||
|
|
Loading…
Reference in a new issue