From 406fc323645878c6cdbd0033f504b80fdd4062d2 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 20 Jun 2016 23:17:28 -0400 Subject: Fixed bug with rotating stats --- troublemaker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'troublemaker.cpp') diff --git a/troublemaker.cpp b/troublemaker.cpp index d924894..04417d7 100644 --- a/troublemaker.cpp +++ b/troublemaker.cpp @@ -184,7 +184,7 @@ int main(int argc, char** argv) std::lock_guard stats_guard(stats_mutex); std::ofstream datafile("data.txt", std::ofstream::out | std::ofstream::trunc); - for (auto mapping : stats) + for (auto& mapping : stats) { auto& s = mapping.second; if (s.days < 7) @@ -198,6 +198,7 @@ int main(int argc, char** argv) s.day4 = s.day3; s.day3 = s.day2; s.day2 = s.day1; + s.day1 = 0; s.total = s.day2 + s.day3 + s.day4 + s.day5 + s.day6 + s.day7; -- cgit 1.4.1