Don't use pass by reference to const for cheaply-copied types (bool, char, etc.).
Don't use pass by reference to const for cheaply-copied types (bool, char, etc.) #10839
pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:dont-pass-by-reference-for-cheaply-copied-types changing 5 files +11 −11-
practicalswift commented at 12:12 AM on July 16, 2017: contributor
- fanquake added the label Refactoring on Jul 16, 2017
-
in src/wallet/wallet.h:825 in 5faf3a618a outdated
821 | @@ -822,7 +822,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface 822 | /** 823 | * populate vCoins with vector of available COutputs. 824 | */ 825 | - void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlySafe=true, const CCoinControl *coinControl = NULL, 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; 826 | + void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlySafe=true, const CCoinControl *coinControl = NULL, 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;
TheBlueMatt commented at 11:15 PM on July 16, 2017:Might as well do it for nMaximumCount as well - copying a 64-bit integer is gonna be faster than pass-by-reference, probably.
practicalswift commented at 8:33 AM on July 17, 2017:Fixed! :-)
practicalswift force-pushed on Jul 17, 2017TheBlueMatt commented at 2:17 PM on July 17, 2017: memberutACK cb0e62fb7338cb592508a9dc1624855ca9c8a769
promag commented at 10:55 AM on July 25, 2017: memberWas
memusage.hignored on purpose? Otherwise ACK.Don't use pass by reference to const for cheaply-copied types (bool, char, etc.). 99ba0c3008practicalswift force-pushed on Aug 14, 2017practicalswift commented at 3:46 PM on August 14, 2017: contributorRebased!
practicalswift renamed this:Don't use pass by reference to const for cheaply-copied types (bool, char, etc.).
Don't use pass by reference to const for cheaply-copied types (bool, char, etc.)
on Aug 29, 2017TheBlueMatt commented at 4:24 PM on December 14, 2017: memberutACK
theuni commented at 4:27 PM on December 14, 2017: memberutACK 99ba0c30087dc45a3805f0cac6d2e534ec52f039
laanwj commented at 5:26 PM on December 14, 2017: memberutACK 99ba0c3
laanwj merged this on Dec 14, 2017laanwj closed this on Dec 14, 2017laanwj referenced this in commit c66adb286a on Dec 14, 2017PastaPastaPasta referenced this in commit 5d1a9bd8ca on Jan 17, 2020PastaPastaPasta referenced this in commit 10de3c2981 on Jan 22, 2020PastaPastaPasta referenced this in commit 3c5e048d72 on Jan 22, 2020PastaPastaPasta referenced this in commit 1452836120 on Jan 29, 2020PastaPastaPasta referenced this in commit 94960d78de on Jan 29, 2020PastaPastaPasta referenced this in commit 818b5a862a on Jan 29, 2020PastaPastaPasta referenced this in commit 49825231fb on Jan 31, 2020ckti referenced this in commit 572abb58a9 on Mar 28, 2021practicalswift deleted the branch on Apr 10, 2021gades referenced this in commit 6ea8473db3 on Jul 1, 2021furszy referenced this in commit 60d36292bc on Jul 26, 2021gades referenced this in commit 95405f51cf on Feb 6, 2022DrahtBot locked this on Aug 18, 2022ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 15:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 15:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me