mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
uint256: Update constructors to c++11, make ONE static
Replace the memset with C++11 value/aggregate initialisation of the m_data array, which still ensures the unspecified values end up as zero-initialised. This then allows changing UINT256_ONE() from dynamically allocating an object, to a simpler referencing a static allocation.
This commit is contained in:
@@ -278,4 +278,10 @@ BOOST_AUTO_TEST_CASE( operator_with_self )
|
||||
BOOST_CHECK(v == UintToArith256(uint256S("0")));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( check_ONE )
|
||||
{
|
||||
uint256 one = uint256S("0000000000000000000000000000000000000000000000000000000000000001");
|
||||
BOOST_CHECK_EQUAL(one, uint256::ONE);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user