From 11c1b7e4dc7835c9550b166b3c82e4f6e9b5f846 Mon Sep 17 00:00:00 2001 From: twanvl Date: Sat, 31 May 2008 22:49:19 +0000 Subject: [PATCH] off by one in mean calculation in Graph git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@923 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/control/graph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/control/graph.cpp b/src/gui/control/graph.cpp index 9c1b1188..af492594 100644 --- a/src/gui/control/graph.cpp +++ b/src/gui/control/graph.cpp @@ -77,7 +77,7 @@ GraphData::GraphData(const GraphDataPre& d) size_t left = counts.size(); int i = 0; while (!counts.empty() && i < 100) { - String is = String() << i++; + String is = String() << i; map::const_iterator it = counts.find(is); if (it == counts.end()) { // not found, add a 0 bar @@ -90,6 +90,7 @@ GraphData::GraphData(const GraphDataPre& d) counts.erase(is); left--; } + i++; } a->mean /= a->total; // drop empty tail