diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-07-19 09:02:37 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-07-19 09:02:37 +0000 |
commit | ff6068be5954674ce2348f673d132797bbf48fe8 (patch) | |
tree | 4fdce06e0fb871497fd73d2c95c34e1f2bd0ef54 | |
parent | d8431d88d9e0833c64d267d35a540ce1827b9217 (diff) |
Avoid holding ref to last generated operation
Move ref away to avoid an unneeded refcount bump and avoid leaving
behind a lingering strong reference to the last generated operation.
-rw-r--r-- | storage/src/vespa/storage/distributor/externaloperationhandler.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/distributor/externaloperationhandler.cpp b/storage/src/vespa/storage/distributor/externaloperationhandler.cpp index 3f3924df229..9ce8d871fc3 100644 --- a/storage/src/vespa/storage/distributor/externaloperationhandler.cpp +++ b/storage/src/vespa/storage/distributor/externaloperationhandler.cpp @@ -97,9 +97,9 @@ ExternalOperationHandler::~ExternalOperationHandler() = default; bool ExternalOperationHandler::handleMessage(const std::shared_ptr<api::StorageMessage>& msg, Operation::SP& op) { - _op = Operation::SP(); + _op.reset(); bool retVal = msg->callHandler(*this, msg); - op = _op; + op = std::move(_op); // Don't maintain any strong refs in _op after we've passed it on. return retVal; } |