mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-11 01:33:21 +01:00
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:
@@ -911,7 +911,7 @@ static void GetWalletBalances(UniValue& result)
|
||||
|
||||
UniValue balances(UniValue::VOBJ);
|
||||
for (const UniValue& wallet : wallets.getValues()) {
|
||||
const std::string wallet_name = wallet.get_str();
|
||||
const std::string& wallet_name = wallet.get_str();
|
||||
const UniValue getbalances = ConnectAndCallRPC(&rh, "getbalances", /* args=*/{}, wallet_name);
|
||||
const UniValue& balance = find_value(getbalances, "result")["mine"]["trusted"];
|
||||
balances.pushKV(wallet_name, balance);
|
||||
|
||||
Reference in New Issue
Block a user