mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
Merge #13480: Avoid copies in range-for loops and add a warning to detect them
d92204c900build: add warning to detect hidden copies in range-for loops (Cory Fields)466e16e0e8cleanup: avoid hidden copies in range-for loops (Cory Fields) Pull request description: Following-up on #13241, which was itself a follow-up of #12169. See title. Fixing these would otherwise be a continuous process, adding the warning should keep them from cropping up. Note that the warning seems to be Clang-only for now. Tree-SHA512: ccfb769c3128b3f92c95715abcf21ee2496fe2aa384f80efead1529a28eeb56b98995b531b49a089f8142601389e63f7bb935963d724eacde4f5e1b4a024934b
This commit is contained in:
@@ -200,7 +200,7 @@ bool WalletInit::Verify() const
|
||||
// Keep track of each wallet absolute path to detect duplicates.
|
||||
std::set<fs::path> wallet_paths;
|
||||
|
||||
for (const auto wallet_file : wallet_files) {
|
||||
for (const auto& wallet_file : wallet_files) {
|
||||
fs::path wallet_path = fs::absolute(wallet_file, GetWalletDir());
|
||||
|
||||
if (!wallet_paths.insert(wallet_path).second) {
|
||||
|
||||
Reference in New Issue
Block a user