From 6f75a7f601c2b8da47e07c4493b858a7ee91bc21 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 27 Nov 2024 01:13:43 +0700 Subject: [PATCH] refactor: use swap instead assign+clean in GetAndClearDirtyGovernanceObjectHashes --- src/masternode/meta.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/masternode/meta.cpp b/src/masternode/meta.cpp index c8499c5cb6..4c2ef7889c 100644 --- a/src/masternode/meta.cpp +++ b/src/masternode/meta.cpp @@ -122,9 +122,8 @@ void CMasternodeMetaMan::RemoveGovernanceObject(const uint256& nGovernanceObject std::vector CMasternodeMetaMan::GetAndClearDirtyGovernanceObjectHashes() { - LOCK(cs); - std::vector vecTmp = std::move(vecDirtyGovernanceObjectHashes); - vecDirtyGovernanceObjectHashes.clear(); + std::vector vecTmp; + WITH_LOCK(cs, vecTmp.swap(vecDirtyGovernanceObjectHashes)); return vecTmp; }