summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-11-23 16:56:26 +0100
committerHenning Baldersheim <balder@oath.com>2018-11-28 09:15:20 +0100
commite2c7c84da195868edb0d5aecf1bcdbc2aa0e0f7c (patch)
treeba16d42d0ed6be169568af2c406b8716292e73de /searchlib
parent68c4f2c38295ed2cda8a5be06f6ab60e2c6218e7 (diff)
= deafult and NULL -> nullptr
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.cpp8
-rw-r--r--searchlib/src/vespa/searchlib/expression/attributenode.cpp14
-rw-r--r--searchlib/src/vespa/searchlib/features/dotproductfeature.cpp6
3 files changed, 11 insertions, 17 deletions
diff --git a/searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.cpp b/searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.cpp
index 8a851b043aa..ff124cec1ab 100644
--- a/searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.cpp
+++ b/searchlib/src/vespa/searchlib/expression/attribute_map_lookup_node.cpp
@@ -99,9 +99,7 @@ public:
};
template <typename T, typename KeyType>
-KeyHandlerT<T,KeyType>::~KeyHandlerT()
-{
-}
+KeyHandlerT<T,KeyType>::~KeyHandlerT() = default;
using IntegerKeyHandler = KeyHandlerT<IAttributeVector::largeint_t>;
using FloatKeyHandler = KeyHandlerT<double>;
@@ -150,9 +148,7 @@ public:
};
template <typename T>
-IndirectKeyHandlerT<T>::~IndirectKeyHandlerT()
-{
-}
+IndirectKeyHandlerT<T>::~IndirectKeyHandlerT() = default;
using IndirectIntegerKeyHandler = IndirectKeyHandlerT<IAttributeVector::largeint_t>;
using IndirectFloatKeyHandler = IndirectKeyHandlerT<double>;
diff --git a/searchlib/src/vespa/searchlib/expression/attributenode.cpp b/searchlib/src/vespa/searchlib/expression/attributenode.cpp
index 0d8f68c1f3e..704000b7a04 100644
--- a/searchlib/src/vespa/searchlib/expression/attributenode.cpp
+++ b/searchlib/src/vespa/searchlib/expression/attributenode.cpp
@@ -74,7 +74,7 @@ namespace {
std::unique_ptr<AttributeResult> createResult(const IAttributeVector * attribute)
{
- return (dynamic_cast<const SingleValueEnumAttributeBase *>(attribute) != NULL)
+ return (dynamic_cast<const SingleValueEnumAttributeBase *>(attribute) != nullptr)
? std::make_unique<EnumAttributeResult>(attribute, 0)
: std::make_unique<AttributeResult>(attribute, 0);
}
@@ -83,18 +83,18 @@ std::unique_ptr<AttributeResult> createResult(const IAttributeVector * attribute
AttributeNode::AttributeNode() :
FunctionNode(),
- _scratchResult(new AttributeResult()),
+ _scratchResult(std::make_unique<AttributeResult>()),
_hasMultiValue(false),
_useEnumOptimization(false),
_handler(),
_attributeName()
{}
-AttributeNode::~AttributeNode() {}
+AttributeNode::~AttributeNode() = default;
AttributeNode::AttributeNode(vespalib::stringref name) :
FunctionNode(),
- _scratchResult(new AttributeResult()),
+ _scratchResult(std::make_unique<AttributeResult>()),
_hasMultiValue(false),
_useEnumOptimization(false),
_handler(),
@@ -136,7 +136,7 @@ AttributeNode & AttributeNode::operator = (const AttributeNode & attr)
void AttributeNode::onPrepare(bool preserveAccurateTypes)
{
const IAttributeVector * attribute = _scratchResult->getAttribute();
- if (attribute != NULL) {
+ if (attribute != nullptr) {
BasicType::Type basicType = attribute->getBasicType();
if (attribute->isIntegerType()) {
if (_hasMultiValue) {
@@ -277,13 +277,13 @@ bool AttributeNode::onExecute() const
void AttributeNode::wireAttributes(const IAttributeContext & attrCtx)
{
const IAttributeVector * attribute(_scratchResult ? _scratchResult->getAttribute() : nullptr);
- if (attribute == NULL) {
+ if (attribute == nullptr) {
if (_useEnumOptimization) {
attribute = attrCtx.getAttributeStableEnum(_attributeName);
} else {
attribute = attrCtx.getAttribute(_attributeName);
}
- if (attribute == NULL) {
+ if (attribute == nullptr) {
throw std::runtime_error(make_string("Failed locating attribute vector '%s'", _attributeName.c_str()));
}
_hasMultiValue = attribute->hasMultiValue();
diff --git a/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp b/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp
index 3688e00d47d..0173455bcf9 100644
--- a/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp
+++ b/searchlib/src/vespa/searchlib/features/dotproductfeature.cpp
@@ -19,8 +19,7 @@ using namespace search::attribute;
using namespace search::fef;
using vespalib::hwaccelrated::IAccelrated;
-namespace search {
-namespace features {
+namespace search::features {
namespace dotproduct {
namespace wset {
@@ -679,5 +678,4 @@ DotProductBlueprint::createExecutor(const IQueryEnvironment & env, vespalib::Sta
return stash.create<SingleZeroValueExecutor>();
}
-} // namespace features
-} // namespace search
+}