I noticed while profiling a related project that operator-() actually calls the base_uint constructor, which is because the postfix operator version of operator++ (used in operator-()) creates a copy of this and returns it.
[arith_uint256] Avoid unnecessary this-copy using prefix operator #12564
pull kallewoof wants to merge 1 commits into bitcoin:master from kallewoof:optim-arith_uint256-operator-dec changing 1 files +1 −1-
kallewoof commented at 11:00 AM on February 28, 2018: member
-
[arith_uint256] Avoid unnecessary this-copy using prefix operator 22b4aae028
- fanquake added the label Refactoring on Feb 28, 2018
-
promag commented at 12:43 PM on February 28, 2018: member
utACK 22b4aae.
-
MarcoFalke commented at 1:59 PM on February 28, 2018: member
utACK 22b4aae028
-
ajtowns commented at 8:55 PM on February 28, 2018: member
utACK 22b4aae0284511e9a6a957197dae237a1799aa20
-
Empact commented at 12:41 AM on March 1, 2018: member
utACK 22b4aae
-
laanwj commented at 2:53 PM on March 5, 2018: member
Hah, you've find a rare example of a case where prefix/postfix decrease actually makes a difference! nice. utACK https://github.com/bitcoin/bitcoin/commit/22b4aae0284511e9a6a957197dae237a1799aa20
- laanwj merged this on Mar 6, 2018
- laanwj closed this on Mar 6, 2018
- laanwj referenced this in commit b7c8812ad0 on Mar 6, 2018
- kallewoof deleted the branch on Mar 6, 2018
- markblundeberg referenced this in commit 1fc4b4a466 on May 23, 2019
- jonspock referenced this in commit e3429d1c4c on Jun 13, 2019
- jtoomim referenced this in commit c4fc668120 on Jun 29, 2019
- PastaPastaPasta referenced this in commit 1dacdf5207 on Jun 10, 2020
- PastaPastaPasta referenced this in commit 400077035f on Jun 13, 2020
- PastaPastaPasta referenced this in commit 6eae72a4ff on Jun 13, 2020
- PastaPastaPasta referenced this in commit 9c1e5bc2b7 on Jun 13, 2020
- PastaPastaPasta referenced this in commit 2d6aec0311 on Jun 17, 2020
- gades referenced this in commit 6ef2d601f7 on Jul 1, 2021
- MarcoFalke locked this on Sep 8, 2021
Labels