Skip to content

Commit 97073f8

Browse files
committed
Merge #13396: Drop unused arith_uint256 ! operator
2acd1d6 Drop uint 256 not operator (Ben Woosley) Pull request description: All the other operators are integer or bitwise operations, and this is unused apart from tests. Note attempting to call `!` on `arith_uint256` results in a build error after this change: ``` test/arith_uint256_tests.cpp:201:17: error: invalid argument type 'const arith_uint256' to unary expression BOOST_CHECK(!ZeroL); ``` Tree-SHA512: 5791b643f426dac9829e9499d678786f1ad294edb2d840879252a1b642bda55941632114f64048660a5991a984aeba49eeb5dfe64ba0a6275cbe7b1c049d7095
2 parents ea263e1 + 2acd1d6 commit 97073f8

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

src/arith_uint256.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ class base_uint
6464

6565
explicit base_uint(const std::string& str);
6666

67-
bool operator!() const
68-
{
69-
for (int i = 0; i < WIDTH; i++)
70-
if (pn[i] != 0)
71-
return false;
72-
return true;
73-
}
74-
7567
const base_uint operator~() const
7668
{
7769
base_uint ret;

src/test/arith_uint256_tests.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ BOOST_AUTO_TEST_CASE( shifts ) { // "<<" ">>" "<<=" ">>="
198198

199199
BOOST_AUTO_TEST_CASE( unaryOperators ) // ! ~ -
200200
{
201-
BOOST_CHECK(!ZeroL);
202-
BOOST_CHECK(!(!OneL));
203-
for (unsigned int i = 0; i < 256; ++i)
204-
BOOST_CHECK(!(!(OneL<<i)));
205-
BOOST_CHECK(!(!R1L));
206-
BOOST_CHECK(!(!MaxL));
207-
208201
BOOST_CHECK(~ZeroL == MaxL);
209202

210203
unsigned char TmpArray[32];

0 commit comments

Comments
 (0)