summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-06-11 23:22:32 +0200
committerHenning Baldersheim <balder@oath.com>2018-06-12 08:41:25 +0200
commit0fe881623917f55b89cffbac34b047b416cfe671 (patch)
tree2379a2f9a560bb496ed98acac727384238217c5e
parentc3cbe79487a64df1432b16507b7a7760b576a5f1 (diff)
No need to do referencecounting just for fun.
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp13
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h2
2 files changed, 5 insertions, 10 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp
index b4f087c65c0..ef818f7b407 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp
@@ -87,8 +87,7 @@ std::shared_ptr<ShrinkLidSpaceFlushTarget> allocShrinker(const AttributeVector::
}
-AttributeManager::AttributeWrap::AttributeWrap(const AttributeVectorSP & a,
- bool isExtra_)
+AttributeManager::AttributeWrap::AttributeWrap(const AttributeVectorSP & a, bool isExtra_)
: _attr(a),
_isExtra(isExtra_)
{
@@ -100,9 +99,7 @@ AttributeManager::AttributeWrap::AttributeWrap()
{
}
-AttributeManager::AttributeWrap::~AttributeWrap()
-{
-}
+AttributeManager::AttributeWrap::~AttributeWrap() = default;
AttributeManager::AttributeWrap
AttributeManager::AttributeWrap::extraAttribute(const AttributeVectorSP &a)
@@ -128,9 +125,7 @@ AttributeManager::FlushableWrap::FlushableWrap(FlushableAttributeSP flusher, Shr
{
}
-AttributeManager::FlushableWrap::~FlushableWrap()
-{
-}
+AttributeManager::FlushableWrap::~FlushableWrap() = default;
AttributeVector::SP
AttributeManager::internalAddAttribute(const AttributeSpec &spec,
@@ -168,7 +163,7 @@ AttributeManager::findAttribute(const vespalib::string &name) const
{
AttributeMap::const_iterator itr = _attributes.find(name);
return (itr != _attributes.end())
- ? static_cast<const AttributeVector::SP &>(itr->second.getAttribute())
+ ? itr->second.getAttribute()
: AttributeVector::SP();
}
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h
index b8f245d9c68..f904c1b4b53 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h
@@ -63,7 +63,7 @@ private:
static AttributeWrap extraAttribute(const AttributeVectorSP &a);
static AttributeWrap normalAttribute(const AttributeVectorSP &a);
bool isExtra() const { return _isExtra; }
- const AttributeVectorSP getAttribute() const { return _attr; }
+ const AttributeVectorSP & getAttribute() const { return _attr; }
};
class FlushableWrap