Skip to content

Commit b7c8812

Browse files
committed
Merge #12564: [arith_uint256] Avoid unnecessary this-copy using prefix operator
22b4aae [arith_uint256] Avoid unnecessary this-copy using prefix operator (Karl-Johan Alm) Pull request description: 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. Tree-SHA512: d9a2665caa3d93f064cdeaf1c6fada101b9943bb53d93ccac6d9a0edac20279d2e921349e30239039c71e0a9629e45c29ec9f10d8d7499e936cdba6cb7c3c3eb
2 parents 85424d7 + 22b4aae commit b7c8812

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/arith_uint256.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class base_uint
8585
base_uint ret;
8686
for (int i = 0; i < WIDTH; i++)
8787
ret.pn[i] = ~pn[i];
88-
ret++;
88+
++ret;
8989
return ret;
9090
}
9191

0 commit comments

Comments
 (0)