diff options
author | fanquake <fanquake@gmail.com> | 2023-10-16 14:56:54 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-10-16 15:35:50 +0100 |
commit | 08ea835220baa88a0e226eff90f66bbae3eb7a0f (patch) | |
tree | d8760ac8bc90b3524abac8f8fa13f11cd8d83633 /src/node | |
parent | 92704535f66976c09a658348e554d47b7f7bcf6e (diff) | |
parent | fa05a726c225dc65dee79367bb67f099ae4f99e6 (diff) | |
download | bitcoin-08ea835220baa88a0e226eff90f66bbae3eb7a0f.tar.xz |
Merge bitcoin/bitcoin#28583: refactor: [tidy] modernize-use-emplace
fa05a726c225dc65dee79367bb67f099ae4f99e6 tidy: modernize-use-emplace (MarcoFalke)
Pull request description:
Constructing a temporary unnamed object only to copy or move it into a container seems both verbose in code and a strict performance penalty.
Fix both issues via the `modernize-use-emplace` tidy check.
ACKs for top commit:
Sjors:
re-utACK fa05a726c2
hebasto:
ACK fa05a726c225dc65dee79367bb67f099ae4f99e6.
TheCharlatan:
ACK fa05a726c225dc65dee79367bb67f099ae4f99e6
Tree-SHA512: 4408a094f406e7bf6c1468c2b0798f68f4d952a1253cf5b20bdc648ad7eea4a2c070051fed46d66fd37bce2ce6f85962484a1d32826b7ab8c9baba431eaa2765
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/blockstorage.cpp | 2 | ||||
-rw-r--r-- | src/node/interfaces.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 931db80274..f8f1aab551 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -458,7 +458,7 @@ bool BlockManager::WriteBlockIndexDB() std::vector<std::pair<int, const CBlockFileInfo*>> vFiles; vFiles.reserve(m_dirty_fileinfo.size()); for (std::set<int>::iterator it = m_dirty_fileinfo.begin(); it != m_dirty_fileinfo.end();) { - vFiles.push_back(std::make_pair(*it, &m_blockfile_info[*it])); + vFiles.emplace_back(*it, &m_blockfile_info[*it]); m_dirty_fileinfo.erase(it++); } std::vector<const CBlockIndex*> vBlocks; diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 4baa0da67c..f6dbe4f008 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -674,7 +674,7 @@ public: if (!m_node.mempool) { std::map<COutPoint, CAmount> bump_fees; for (const auto& outpoint : outpoints) { - bump_fees.emplace(std::make_pair(outpoint, 0)); + bump_fees.emplace(outpoint, 0); } return bump_fees; } |