refactor: Make const refs vars where applicable

This avoids initializing variables with the copy-constructor of a
non-trivially copyable type.
This commit is contained in:
Aurèle Oulès
2022-07-26 11:12:53 +02:00
parent 7f79746bf0
commit 081b0e53e3
27 changed files with 39 additions and 39 deletions

View File

@@ -1789,7 +1789,7 @@ std::map<CKeyID, CKey> DescriptorScriptPubKeyMan::GetKeys() const
AssertLockHeld(cs_desc_man);
if (m_storage.HasEncryptionKeys() && !m_storage.IsLocked()) {
KeyMap keys;
for (auto key_pair : m_map_crypted_keys) {
for (const auto& key_pair : m_map_crypted_keys) {
const CPubKey& pubkey = key_pair.second.first;
const std::vector<unsigned char>& crypted_secret = key_pair.second.second;
CKey key;