This change prevents double scanning the transaction hash when sorting COutPoint. Mostly relevant when COutPoint is the std::set or std::map key type.
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-
promag commented at 4:19 AM on March 18, 2016: member
- promag force-pushed on Mar 18, 2016
-
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:aandbare not available at this point. You might need to useother.dataanddata(self context).
promag commented at 8:01 AM on March 18, 2016:Oh man, feeling stupid about copy&paste.. It was really late..
jonasschnelli added the label Refactoring on Mar 18, 2016Improve COutPoint less operator 0f176927f8promag force-pushed on Mar 18, 2016sipa commented at 3:02 PM on March 20, 2016: memberACK
dcousens commented at 12:37 AM on March 21, 2016: contributorutACK 0f17692
laanwj commented at 11:50 AM on March 21, 2016: memberutACK 0f17692
laanwj merged this on Mar 21, 2016laanwj closed this on Mar 21, 2016laanwj referenced this in commit 3c27067dd2 on Mar 21, 2016codablock referenced this in commit 7038ab857f on Sep 16, 2017codablock referenced this in commit f6bfc52b10 on Sep 19, 2017codablock referenced this in commit c489f1761a on Dec 9, 2017codablock referenced this in commit 04bf554ab4 on Dec 19, 2017MarcoFalke locked this on Sep 8, 2021ContributorsLabels
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 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
More mirrored repositories can be found on mirror.b10c.me