aboutsummaryrefslogtreecommitdiff
path: root/hotline/stats.go
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-11-28 00:39:17 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2025-11-28 00:39:17 +0100
commit9f67542d8469db45c823e347b1868b3582d9e5a7 (patch)
tree88741b3d8633758e4f6f5cbc292f338bc99602a0 /hotline/stats.go
parent8f9edf2f3bb18f7ab1a04ead182a1daf2cfd41d9 (diff)
parent8ddb9bb228389b198a76d6df21de005da4fad66b (diff)
Merge branch 'master' of https://github.com/jhalter/mobiusHEADmain
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) {