Correct percentile calculation for multiple days

- Previously, would stop and return 0 if any day in range was suumary only
- Now, just ignores summary-only days if there are days with data
- Re-indentation makes change look bigger than it is
This commit is contained in:
Guy Scharf 2020-09-08 19:54:56 -07:00
parent 555639e78b
commit 6406545c33

View File

@ -1724,17 +1724,18 @@ EventDataType Profile::calcPercentile(ChannelID code, EventDataType percent, Mac
qint64 SN = 0; qint64 SN = 0;
bool timeweight; bool timeweight;
bool summaryOnly = false; bool summaryOnly = true;
do { do {
Day *day = GetGoodDay(date, mt); Day *day = GetGoodDay(date, mt);
if (day) { if (day) {
if (day->summaryOnly()) { if (day->summaryOnly()) {
summaryOnly = true; date = date.addDays(1);
break; continue;
} }
summaryOnly = false;
// why was this nested like this??? // why was this nested like this???
//for (int i = 0; i < day->size(); i++) { //for (int i = 0; i < day->size(); i++) {
for (auto & sess : day->sessions) { for (auto & sess : day->sessions) {