aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-12-10 20:11:11 -0800
committerChris Robinson <[email protected]>2019-12-10 20:11:11 -0800
commitae916929c95d676c14279d701f105819e9e62a13 (patch)
tree1c1c4009ce6d47d92a4ef74c36b1e0b38f42024b /utils
parent47f416efafd751b2a92ed01882f6c4ad3d4c3587 (diff)
Simplify a status-checking loop
Diffstat (limited to 'utils')
-rw-r--r--utils/makemhr/makemhr.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/utils/makemhr/makemhr.cpp b/utils/makemhr/makemhr.cpp
index 42a384db..f10083a5 100644
--- a/utils/makemhr/makemhr.cpp
+++ b/utils/makemhr/makemhr.cpp
@@ -812,17 +812,16 @@ static void ReconstructHrirs(const HrirDataT *hData)
/* Keep track of the number of IRs done, periodically reporting it. */
size_t count;
- while((count=reconstructor.mDone.load()) != total)
- {
+ do {
+ std::this_thread::sleep_for(std::chrono::milliseconds{50});
+
+ count = reconstructor.mDone.load();
size_t pcdone{count * 100 / total};
printf("\r%3zu%% done (%zu of %zu)", pcdone, count, total);
fflush(stdout);
-
- std::this_thread::sleep_for(std::chrono::milliseconds{50});
- }
- size_t pcdone{count * 100 / total};
- printf("\r%3zu%% done (%zu of %zu)\n", pcdone, count, total);
+ } while(count != total);
+ fputc('\n', stdout);
if(thrd2.joinable()) thrd2.join();
if(thrd1.joinable()) thrd1.join();