mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +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:
@@ -80,7 +80,4 @@ template std::string base_blob<256>::ToString() const;
|
||||
template void base_blob<256>::SetHex(const char*);
|
||||
template void base_blob<256>::SetHex(const std::string&);
|
||||
|
||||
uint256& UINT256_ONE() {
|
||||
static uint256* one = new uint256(uint256S("0000000000000000000000000000000000000000000000000000000000000001"));
|
||||
return *one;
|
||||
}
|
||||
const uint256 uint256::ONE(1);
|
||||
|
||||
Reference in New Issue
Block a user