aboutsummaryrefslogtreecommitdiff
path: root/hotline/stats.go
diff options
context:
space:
mode:
Diffstat (limited to 'hotline/stats.go')
-rw-r--r--hotline/stats.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/hotline/stats.go b/hotline/stats.go
index 316a67d..9731601 100644
--- a/hotline/stats.go
+++ b/hotline/stats.go
@@ -61,7 +61,9 @@ func (s *Stats) Decrement(key int) {
s.mu.Lock()
defer s.mu.Unlock()
- s.stats[key]--
+ if s.stats[key] > 0 {
+ s.stats[key]--
+ }
}
func (s *Stats) Set(key, val int) {