diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-11-20 00:14:32 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-01-31 17:35:16 +0100 |
commit | e829c9afbf75e930db6c3fe77a269b0af5e7a3ad (patch) | |
tree | 6623bb198d779b51ebf6611c8a01709dba9a50d0 /src/test/hash_tests.cpp | |
parent | 365539c84691d470b44d35df374d8c049f8c1192 (diff) | |
download | bitcoin-e829c9afbf75e930db6c3fe77a269b0af5e7a3ad.tar.xz |
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.
Diffstat (limited to 'src/test/hash_tests.cpp')
-rw-r--r-- | src/test/hash_tests.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/hash_tests.cpp b/src/test/hash_tests.cpp index 87f6470afa..41a626c0ea 100644 --- a/src/test/hash_tests.cpp +++ b/src/test/hash_tests.cpp @@ -107,14 +107,14 @@ BOOST_AUTO_TEST_CASE(siphash) // Check test vectors from spec, one byte at a time CSipHasher hasher2(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL); - for (uint8_t x=0; x<ARRAYLEN(siphash_4_2_testvec); ++x) + for (uint8_t x=0; x<std::size(siphash_4_2_testvec); ++x) { BOOST_CHECK_EQUAL(hasher2.Finalize(), siphash_4_2_testvec[x]); hasher2.Write(&x, 1); } // Check test vectors from spec, eight bytes at a time CSipHasher hasher3(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL); - for (uint8_t x=0; x<ARRAYLEN(siphash_4_2_testvec); x+=8) + for (uint8_t x=0; x<std::size(siphash_4_2_testvec); x+=8) { BOOST_CHECK_EQUAL(hasher3.Finalize(), siphash_4_2_testvec[x]); hasher3.Write(uint64_t(x)|(uint64_t(x+1)<<8)|(uint64_t(x+2)<<16)|(uint64_t(x+3)<<24)| |