From 706f4822165d961d6e923464106c93f169752feb Mon Sep 17 00:00:00 2001 From: Qyriad Date: Wed, 19 Jun 2024 18:51:23 -0600 Subject: [PATCH] slight cleanup to ProgressBar::getStatus() Binaries were identical before and after this commit on our machine Change-Id: I6f8bfbe3298d6c5f43d5702c7a1e05cb180226cc --- src/libmain/progress-bar.cc | 12 ++++++------ 1 file 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);