Skip to content

Commit c66adb2

Browse files
committed
Merge #10839: Don't use pass by reference to const for cheaply-copied types (bool, char, etc.)
99ba0c3 Don't use pass by reference to const for cheaply-copied types (bool, char, etc.). (practicalswift) Pull request description: Don't use pass by reference to const for cheaply-copied types (`bool`, `char`, etc.). Tree-SHA512: ccad5e2695dff0b3d6de3e713ff3448f2981168cdac72d73bee10ad346b9919d8d4d588933369e54657a244b8b222fa0bef919bc56d983e1fa64b2004e51b225
2 parents 3c8f0a3 + 99ba0c3 commit c66adb2

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/qt/sendcoinsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void SendCoinsDialog::setModel(WalletModel *_model)
162162
coinControlUpdateLabels();
163163

164164
// fee section
165-
for (const int &n : confTargets) {
165+
for (const int n : confTargets) {
166166
ui->confTargetSelector->addItem(tr("%1 (%2 blocks)").arg(GUIUtil::formatNiceTimeOffset(n*Params().GetConsensus().nPowTargetSpacing)).arg(n));
167167
}
168168
connect(ui->confTargetSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSmartFeeLabel()));

src/streams.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ class CDataStream
241241
const_reference operator[](size_type pos) const { return vch[pos + nReadPos]; }
242242
reference operator[](size_type pos) { return vch[pos + nReadPos]; }
243243
void clear() { vch.clear(); nReadPos = 0; }
244-
iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
245-
void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }
244+
iterator insert(iterator it, const char x=char()) { return vch.insert(it, x); }
245+
void insert(iterator it, size_type n, const char x) { vch.insert(it, n, x); }
246246
value_type* data() { return vch.data() + nReadPos; }
247247
const value_type* data() const { return vch.data() + nReadPos; }
248248

src/wallet/rpcdump.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,8 @@ UniValue ProcessImport(CWallet * const pwallet, const UniValue& data, const int6
721721
const std::string& strRedeemScript = data.exists("redeemscript") ? data["redeemscript"].get_str() : "";
722722
const UniValue& pubKeys = data.exists("pubkeys") ? data["pubkeys"].get_array() : UniValue();
723723
const UniValue& keys = data.exists("keys") ? data["keys"].get_array() : UniValue();
724-
const bool& internal = data.exists("internal") ? data["internal"].get_bool() : false;
725-
const bool& watchOnly = data.exists("watchonly") ? data["watchonly"].get_bool() : false;
724+
const bool internal = data.exists("internal") ? data["internal"].get_bool() : false;
725+
const bool watchOnly = data.exists("watchonly") ? data["watchonly"].get_bool() : false;
726726
const std::string& label = data.exists("label") && !internal ? data["label"].get_str() : "";
727727

728728
bool isScript = scriptPubKey.getType() == UniValue::VSTR;

src/wallet/wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@ CAmount CWalletTx::GetAvailableCredit(bool fUseCache) const
18681868
return nCredit;
18691869
}
18701870

1871-
CAmount CWalletTx::GetImmatureWatchOnlyCredit(const bool& fUseCache) const
1871+
CAmount CWalletTx::GetImmatureWatchOnlyCredit(const bool fUseCache) const
18721872
{
18731873
if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain())
18741874
{
@@ -1882,7 +1882,7 @@ CAmount CWalletTx::GetImmatureWatchOnlyCredit(const bool& fUseCache) const
18821882
return 0;
18831883
}
18841884

1885-
CAmount CWalletTx::GetAvailableWatchOnlyCredit(const bool& fUseCache) const
1885+
CAmount CWalletTx::GetAvailableWatchOnlyCredit(const bool fUseCache) const
18861886
{
18871887
if (pwallet == nullptr)
18881888
return 0;
@@ -2172,7 +2172,7 @@ CAmount CWallet::GetAvailableBalance(const CCoinControl* coinControl) const
21722172
return balance;
21732173
}
21742174

2175-
void CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, const CCoinControl *coinControl, const CAmount &nMinimumAmount, const CAmount &nMaximumAmount, const CAmount &nMinimumSumAmount, const uint64_t &nMaximumCount, const int &nMinDepth, const int &nMaxDepth) const
2175+
void CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, const CCoinControl *coinControl, const CAmount &nMinimumAmount, const CAmount &nMaximumAmount, const CAmount &nMinimumSumAmount, const uint64_t nMaximumCount, const int nMinDepth, const int nMaxDepth) const
21762176
{
21772177
vCoins.clear();
21782178

src/wallet/wallet.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ class CWalletTx : public CMerkleTx
445445
CAmount GetCredit(const isminefilter& filter) const;
446446
CAmount GetImmatureCredit(bool fUseCache=true) const;
447447
CAmount GetAvailableCredit(bool fUseCache=true) const;
448-
CAmount GetImmatureWatchOnlyCredit(const bool& fUseCache=true) const;
449-
CAmount GetAvailableWatchOnlyCredit(const bool& fUseCache=true) const;
448+
CAmount GetImmatureWatchOnlyCredit(const bool fUseCache=true) const;
449+
CAmount GetAvailableWatchOnlyCredit(const bool fUseCache=true) const;
450450
CAmount GetChange() const;
451451

452452
void GetAmounts(std::list<COutputEntry>& listReceived,
@@ -830,7 +830,7 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface
830830
/**
831831
* populate vCoins with vector of available COutputs.
832832
*/
833-
void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlySafe=true, const CCoinControl *coinControl = nullptr, const CAmount& nMinimumAmount = 1, const CAmount& nMaximumAmount = MAX_MONEY, const CAmount& nMinimumSumAmount = MAX_MONEY, const uint64_t& nMaximumCount = 0, const int& nMinDepth = 0, const int& nMaxDepth = 9999999) const;
833+
void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlySafe=true, const CCoinControl *coinControl = nullptr, const CAmount& nMinimumAmount = 1, const CAmount& nMaximumAmount = MAX_MONEY, const CAmount& nMinimumSumAmount = MAX_MONEY, const uint64_t nMaximumCount = 0, const int nMinDepth = 0, const int nMaxDepth = 9999999) const;
834834

835835
/**
836836
* Return list of available coins and locked coins grouped by non-change output address.

0 commit comments

Comments
 (0)