Commit 4953501a authored by twanvl's avatar twanvl

off by one in mean calculation in Graph

parent 8cf760e7
...@@ -77,7 +77,7 @@ GraphData::GraphData(const GraphDataPre& d) ...@@ -77,7 +77,7 @@ GraphData::GraphData(const GraphDataPre& d)
size_t left = counts.size(); size_t left = counts.size();
int i = 0; int i = 0;
while (!counts.empty() && i < 100) { while (!counts.empty() && i < 100) {
String is = String() << i++; String is = String() << i;
map<String,UInt>::const_iterator it = counts.find(is); map<String,UInt>::const_iterator it = counts.find(is);
if (it == counts.end()) { if (it == counts.end()) {
// not found, add a 0 bar // not found, add a 0 bar
...@@ -90,6 +90,7 @@ GraphData::GraphData(const GraphDataPre& d) ...@@ -90,6 +90,7 @@ GraphData::GraphData(const GraphDataPre& d)
counts.erase(is); counts.erase(is);
left--; left--;
} }
i++;
} }
a->mean /= a->total; a->mean /= a->total;
// drop empty tail // drop empty tail
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment