aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2017-01-02 20:56:21 +0100
committerSimon Warta <[email protected]>2017-01-02 20:57:19 +0100
commit4b54b03df9103909e45873d93dd081d202e00c43 (patch)
treee8d9069bf916167642f79ba2ad876aaf8a68924b /src/tests
parentcc760f3a67cc136a30f707e19f1e9d2f01297959 (diff)
Simplify loop to foreach in test_random_integer()
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_bigint.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp
index f07c82330..e23f50055 100644
--- a/src/tests/test_bigint.cpp
+++ b/src/tests/test_bigint.cpp
@@ -162,9 +162,9 @@ class BigInt_Unit_Tests : public Test
counts[r - range_min] += 1;
}
- for(size_t i = 0; i != counts.size(); ++i)
+ for(const auto count : counts)
{
- double ratio = static_cast<double>(counts[i]) / ITERATIONS_PER_POSSIBLE_VALUE;
+ double ratio = static_cast<double>(count) / ITERATIONS_PER_POSSIBLE_VALUE;
if(ratio >= 0.85 && ratio <= 1.15) // +/-15 %
{