diff options
author | Geir Storli <geirstorli@yahoo.no> | 2018-06-12 10:36:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-12 10:36:56 +0200 |
commit | ec73b3c1d58136290584bb680da8bffb06bf86e0 (patch) | |
tree | 544821f80ce03d1740cb30e08b6b979b6ac8e03d | |
parent | 89ead432a408a7e048a0ebf87b381cddf5636240 (diff) | |
parent | 0fe881623917f55b89cffbac34b047b416cfe671 (diff) |
Merge pull request #6170 from vespa-engine/balder/avoid-unneccessary-refcounting
No need to do referencecounting just for fun.
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp | 13 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/attribute/attributemanager.h | 2 |
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 |