Improve COutPoint less operator #7712

pull promag wants to merge 1 commits into bitcoin:master from uphold:enhancement/improve-coutpoint-less-operator changing 2 files +7 −4
  1. promag commented at 4:19 AM on March 18, 2016: member

    This change prevents double scanning the transaction hash when sorting COutPoint. Mostly relevant when COutPoint is the std::set or std::map key type.

  2. promag force-pushed on Mar 18, 2016
  3. in src/uint256.h:None in 5ebf32c42c outdated
      41 | @@ -42,9 +42,11 @@ class base_blob
      42 |          memset(data, 0, sizeof(data));
      43 |      }
      44 |  
      45 | -    friend inline bool operator==(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) == 0; }
      46 | -    friend inline bool operator!=(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) != 0; }
      47 | -    friend inline bool operator<(const base_blob& a, const base_blob& b) { return memcmp(a.data, b.data, sizeof(a.data)) < 0; }
      48 | +    inline int Compare(const base_blob& other) const { return memcmp(a.data, b.data, sizeof(a.data)); }
    


    jonasschnelli commented at 7:29 AM on March 18, 2016:

    a and b are not available at this point. You might need to use other.data and data (self context).


    promag commented at 8:01 AM on March 18, 2016:

    Oh man, feeling stupid about copy&paste.. It was really late..

  4. jonasschnelli added the label Refactoring on Mar 18, 2016
  5. Improve COutPoint less operator 0f176927f8
  6. promag force-pushed on Mar 18, 2016
  7. sipa commented at 3:02 PM on March 20, 2016: member

    ACK

  8. dcousens commented at 12:37 AM on March 21, 2016: contributor

    utACK 0f17692

  9. laanwj commented at 11:50 AM on March 21, 2016: member

    utACK 0f17692

  10. laanwj merged this on Mar 21, 2016
  11. laanwj closed this on Mar 21, 2016

  12. laanwj referenced this in commit 3c27067dd2 on Mar 21, 2016
  13. codablock referenced this in commit 7038ab857f on Sep 16, 2017
  14. codablock referenced this in commit f6bfc52b10 on Sep 19, 2017
  15. codablock referenced this in commit c489f1761a on Dec 9, 2017
  16. codablock referenced this in commit 04bf554ab4 on Dec 19, 2017
  17. MarcoFalke locked this on Sep 8, 2021

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-22 00:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me