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
  1. practicalswift commented at 12:12 AM on July 16, 2017: contributor

    Don't use pass by reference to const for cheaply-copied types (bool, char, etc.).

  2. fanquake added the label Refactoring on Jul 16, 2017
  3. 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! :-)

  4. practicalswift force-pushed on Jul 17, 2017
  5. TheBlueMatt commented at 2:17 PM on July 17, 2017: member

    utACK cb0e62fb7338cb592508a9dc1624855ca9c8a769

  6. promag commented at 10:55 AM on July 25, 2017: member

    Was memusage.h ignored on purpose? Otherwise ACK.

  7. Don't use pass by reference to const for cheaply-copied types (bool, char, etc.). 99ba0c3008
  8. practicalswift force-pushed on Aug 14, 2017
  9. practicalswift commented at 3:46 PM on August 14, 2017: contributor

    Rebased!

  10. 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, 2017
  11. TheBlueMatt commented at 4:24 PM on December 14, 2017: member

    utACK

  12. theuni commented at 4:27 PM on December 14, 2017: member

    utACK 99ba0c30087dc45a3805f0cac6d2e534ec52f039

  13. laanwj commented at 5:26 PM on December 14, 2017: member

    utACK 99ba0c3

  14. laanwj merged this on Dec 14, 2017
  15. laanwj closed this on Dec 14, 2017

  16. laanwj referenced this in commit c66adb286a on Dec 14, 2017
  17. PastaPastaPasta referenced this in commit 5d1a9bd8ca on Jan 17, 2020
  18. PastaPastaPasta referenced this in commit 10de3c2981 on Jan 22, 2020
  19. PastaPastaPasta referenced this in commit 3c5e048d72 on Jan 22, 2020
  20. PastaPastaPasta referenced this in commit 1452836120 on Jan 29, 2020
  21. PastaPastaPasta referenced this in commit 94960d78de on Jan 29, 2020
  22. PastaPastaPasta referenced this in commit 818b5a862a on Jan 29, 2020
  23. PastaPastaPasta referenced this in commit 49825231fb on Jan 31, 2020
  24. ckti referenced this in commit 572abb58a9 on Mar 28, 2021
  25. practicalswift deleted the branch on Apr 10, 2021
  26. gades referenced this in commit 6ea8473db3 on Jul 1, 2021
  27. furszy referenced this in commit 60d36292bc on Jul 26, 2021
  28. gades referenced this in commit 95405f51cf on Feb 6, 2022
  29. DrahtBot locked this on Aug 18, 2022

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 site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me