1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: exclude zero entries

This commit is contained in:
Ferdinand Mütsch 2021-06-12 12:04:38 +02:00
parent 561198b203
commit 69627fbe11

View File

@ -163,14 +163,18 @@ func (s *Summary) FillBy(fromType uint8, toType uint8) {
break break
} }
} }
if existingEntryIdx >= 0 {
(*typeItems[toType])[existingEntryIdx].Total = (totalWanted - totalActual) / time.Second // workaround total := (totalWanted - totalActual) / time.Second // workaround
} else { if total > 0 {
*typeItems[toType] = append(*typeItems[toType], &SummaryItem{ if existingEntryIdx >= 0 {
Type: toType, (*typeItems[toType])[existingEntryIdx].Total = total
Key: key, } else {
Total: (totalWanted - totalActual) / time.Second, // workaround *typeItems[toType] = append(*typeItems[toType], &SummaryItem{
}) Type: toType,
Key: key,
Total: total,
})
}
} }
} }