diff options
author | Henning Baldersheim <balder@oath.com> | 2018-08-27 09:21:30 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-08-27 09:22:14 +0200 |
commit | 4b2f2f0195b4b3c4483d5539b8f50cdd83eb5bf6 (patch) | |
tree | 3db97672b8e1426b17390e9a1a91444052fe3608 /searchcore | |
parent | f19fa359f112f0009a4a39e9e8358a5458ca4fb2 (diff) |
Move smartpointers
Diffstat (limited to 'searchcore')
3 files changed, 5 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp index 2ca4fd0a20d..7ad2dc15b0d 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attributemanager.cpp @@ -593,7 +593,7 @@ AttributeManager::asyncForAttribute(const vespalib::string &name, std::shared_pt } AttributeVector::SP attrsp = itr->second.getAttribute(); _attributeFieldWriter.execute(_attributeFieldWriter.getExecutorId(attrsp->getNamePrefix()), - [attrsp, func]() { (*func)(*attrsp); }); + [attr=std::move(attrsp), func=std::move(func)]() { (*func)(*attr); }); } ExclusiveAttributeReadAccessor::UP diff --git a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp index 7928bc5cc27..32231038691 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/filter_attribute_manager.cpp @@ -206,7 +206,7 @@ FilterAttributeManager::asyncForAttribute(const vespalib::string &name, std::sha if (!attr) { return; } search::ISequencedTaskExecutor &attributeFieldWriter = getAttributeFieldWriter(); attributeFieldWriter.execute(attributeFieldWriter.getExecutorId((*attr)->getNamePrefix()), - [attr=std::move(attr), func]() mutable { + [attr=std::move(attr), func=std::move(func)]() mutable { (*func)(dynamic_cast<const search::AttributeVector&>(*attr)); }); diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h b/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h index 9fc019a2ded..874ea0c460d 100644 --- a/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h +++ b/searchcore/src/vespa/searchcore/proton/test/mock_attribute_manager.h @@ -75,7 +75,9 @@ public: const ImportedAttributesRepo *getImportedAttributes() const override { return _importedAttributes.get(); } - void asyncForAttribute(const vespalib::string &, std::shared_ptr<IAttributeFunctor>) const override { } + void asyncForAttribute(const vespalib::string & name, std::shared_ptr<IAttributeFunctor> func) const override { + _mock.asyncForAttribute(name, std::move(func)); + } }; } |