- stats: if "SET" to zero, stat is removed

pull/1/head
bloved 2021-01-14 00:20:23 +01:00
parent 945709f24e
commit 15ec9f49ac
1 changed files with 6 additions and 1 deletions

View File

@ -81,7 +81,12 @@ func statsThread() {
case "INC":
ZabovStats[item.Payload] += item.Number
case "SET":
ZabovStats[item.Payload] = item.Number
if item.Number == 0 {
delete(ZabovStats, item.Payload)
} else {
ZabovStats[item.Payload] = item.Number
}
case "PRI":
statsPrint()
}