refactor: replace sizeof(a)/sizeof(a[0]) by std::size (C++17)
Removes the macro ARRAYLEN and also substitutes all other uses of the same "sizeof(a)/sizeof(a[0])" pattern by std::size, available since C++17.
This commit is contained in:
1 parent
365539c846
commit
e829c9afbf
9 files changed
+12
-15
No files matched your search
+1
-1
@@ -52,7 +52,7 @@ static const int8_t mapBase58[256] = {
|
||||
int size = strlen(psz) * 733 /1000 + 1; // log(58) / log(256), rounded up.
|
||||
std::vector<unsigned char> b256(size);
|
||||
// Process the characters.
|
||||
static_assert(sizeof(mapBase58)/sizeof(mapBase58[0]) == 256, "mapBase58.size() should be 256"); // guarantee not out of range
|
||||
static_assert(std::size(mapBase58) == 256, "mapBase58.size() should be 256"); // guarantee not out of range
|
||||
while (*psz && !IsSpace(*psz)) {
|
||||
// Decode base58 character
|
||||
int carry = mapBase58[(uint8_t)*psz];
|
||||
|
||||
Reference in new issue
Block a user