From 3692c11f39ae502b0bdd8e21aedcc7cefb4bbdc4 Mon Sep 17 00:00:00 2001 From: kimwalisch Date: Mon, 12 Feb 2024 12:55:30 +0100 Subject: [PATCH] Refactor --- src/app/stressTest.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/stressTest.cpp b/src/app/stressTest.cpp index 03a46eedb..075bf16bd 100644 --- a/src/app/stressTest.cpp +++ b/src/app/stressTest.cpp @@ -16,7 +16,6 @@ /// #include -#include #include #include #include "CmdOptions.hpp" @@ -149,8 +148,7 @@ void stressTest(const CmdOptions& opts) // same time, which allows us to more effectively limit the status // output (print results of a different thread every 10 secs). uint64_t dist = primeCounts.size() / threads; - dist += (dist % 2 == 0); - ASSERT(dist >= 1 && dist % 2 == 1); + dist = std::max((uint64_t) 1, dist); uint64_t startIndex = 1 + (dist * threadId) % primeCounts.size(); // The thread keeps on running forever. It only stops if