mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#28583: refactor: [tidy] modernize-use-emplace
fa05a726c2tidy: 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-utACKfa05a726c2hebasto: ACKfa05a726c2. TheCharlatan: ACKfa05a726c2Tree-SHA512: 4408a094f406e7bf6c1468c2b0798f68f4d952a1253cf5b20bdc648ad7eea4a2c070051fed46d66fd37bce2ce6f85962484a1d32826b7ab8c9baba431eaa2765
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user