aboutsummaryrefslogtreecommitdiff
path: root/src/test/scriptnum_tests.cpp
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-11-20 00:14:32 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-01-31 17:35:16 +0100
commite829c9afbf75e930db6c3fe77a269b0af5e7a3ad (patch)
tree6623bb198d779b51ebf6611c8a01709dba9a50d0 /src/test/scriptnum_tests.cpp
parent365539c84691d470b44d35df374d8c049f8c1192 (diff)
downloadbitcoin-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/scriptnum_tests.cpp')
-rw-r--r--src/test/scriptnum_tests.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/scriptnum_tests.cpp b/src/test/scriptnum_tests.cpp
index 281018be9f..746d4d3c6b 100644
--- a/src/test/scriptnum_tests.cpp
+++ b/src/test/scriptnum_tests.cpp
@@ -164,9 +164,9 @@ static void RunOperators(const int64_t& num1, const int64_t& num2)
BOOST_AUTO_TEST_CASE(creation)
{
- for(size_t i = 0; i < sizeof(values) / sizeof(values[0]); ++i)
+ for(size_t i = 0; i < std::size(values); ++i)
{
- for(size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j)
+ for(size_t j = 0; j < std::size(offsets); ++j)
{
RunCreate(values[i]);
RunCreate(values[i] + offsets[j]);
@@ -177,9 +177,9 @@ BOOST_AUTO_TEST_CASE(creation)
BOOST_AUTO_TEST_CASE(operators)
{
- for(size_t i = 0; i < sizeof(values) / sizeof(values[0]); ++i)
+ for(size_t i = 0; i < std::size(values); ++i)
{
- for(size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j)
+ for(size_t j = 0; j < std::size(offsets); ++j)
{
RunOperators(values[i], values[i]);
RunOperators(values[i], -values[i]);