aboutsummaryrefslogtreecommitdiff
path: root/src/libmain/progress-bar.cc
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-06-19 18:51:23 -0600
committerQyriad <qyriad@qyriad.me>2024-06-20 15:24:27 +0000
commit3a4c21fc9e76a31d2a51b2ccce6c21c817e4c555 (patch)
tree7623cea7d9db54c66ba80c2ee5306302a59c0fea /src/libmain/progress-bar.cc
parent697ef65c148a48e5d8255b6425b6ca3a5b7d0be8 (diff)
slight cleanup to ProgressBar::getStatus()
Binaries were identical before and after this commit on our machine Change-Id: I6f8bfbe3298d6c5f43d5702c7a1e05cb180226cc
Diffstat (limited to 'src/libmain/progress-bar.cc')
-rw-r--r--src/libmain/progress-bar.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc
index d83b09cd4..b837eee8a 100644
--- a/src/libmain/progress-bar.cc
+++ b/src/libmain/progress-bar.cc
@@ -414,18 +414,18 @@ public:
std::string getStatus(State & state)
{
- auto MiB = 1024.0 * 1024.0;
+ constexpr auto MiB = 1024.0 * 1024.0;
std::string res;
auto renderActivity = [&](ActivityType type, const std::string & itemFmt, const std::string & numberFmt = "%d", double unit = 1) {
auto & act = state.activitiesByType[type];
uint64_t done = act.done, expected = act.done, running = 0, failed = act.failed;
- for (auto & j : act.its) {
- done += j.second->done;
- expected += j.second->expected;
- running += j.second->running;
- failed += j.second->failed;
+ for (auto & [actId, infoIt] : act.its) {
+ done += infoIt->done;
+ expected += infoIt->expected;
+ running += infoIt->running;
+ failed += infoIt->failed;
}
expected = std::max(expected, act.expected);