mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-23 18:32:45 +02:00
Remove duplicate static_asserts
One should be enough. Can be reviewed with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
This commit is contained in:
parent
d0f7493b6c
commit
fa456ccb22
@ -24,22 +24,19 @@ template<unsigned int BITS>
|
|||||||
class base_uint
|
class base_uint
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
static_assert(BITS / 32 > 0 && BITS % 32 == 0, "Template parameter BITS must be a positive multiple of 32.");
|
||||||
static constexpr int WIDTH = BITS / 32;
|
static constexpr int WIDTH = BITS / 32;
|
||||||
uint32_t pn[WIDTH];
|
uint32_t pn[WIDTH];
|
||||||
public:
|
public:
|
||||||
|
|
||||||
base_uint()
|
base_uint()
|
||||||
{
|
{
|
||||||
static_assert(BITS/32 > 0 && BITS%32 == 0, "Template parameter BITS must be a positive multiple of 32.");
|
|
||||||
|
|
||||||
for (int i = 0; i < WIDTH; i++)
|
for (int i = 0; i < WIDTH; i++)
|
||||||
pn[i] = 0;
|
pn[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
base_uint(const base_uint& b)
|
base_uint(const base_uint& b)
|
||||||
{
|
{
|
||||||
static_assert(BITS/32 > 0 && BITS%32 == 0, "Template parameter BITS must be a positive multiple of 32.");
|
|
||||||
|
|
||||||
for (int i = 0; i < WIDTH; i++)
|
for (int i = 0; i < WIDTH; i++)
|
||||||
pn[i] = b.pn[i];
|
pn[i] = b.pn[i];
|
||||||
}
|
}
|
||||||
@ -53,8 +50,6 @@ public:
|
|||||||
|
|
||||||
base_uint(uint64_t b)
|
base_uint(uint64_t b)
|
||||||
{
|
{
|
||||||
static_assert(BITS/32 > 0 && BITS%32 == 0, "Template parameter BITS must be a positive multiple of 32.");
|
|
||||||
|
|
||||||
pn[0] = (unsigned int)b;
|
pn[0] = (unsigned int)b;
|
||||||
pn[1] = (unsigned int)(b >> 32);
|
pn[1] = (unsigned int)(b >> 32);
|
||||||
for (int i = 2; i < WIDTH; i++)
|
for (int i = 2; i < WIDTH; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user