From 98a180752863e9df784e8f8f170adb64e365234b Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 16 Mar 2021 12:14:36 +0200 Subject: [PATCH] Inline Histogram.resetLocked function --- histogram.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/histogram.go b/histogram.go index 0f6018b..b0e8d57 100644 --- a/histogram.go +++ b/histogram.go @@ -60,11 +60,6 @@ type Histogram struct { // Reset resets the given histogram. func (h *Histogram) Reset() { h.mu.Lock() - h.resetLocked() - h.mu.Unlock() -} - -func (h *Histogram) resetLocked() { for _, db := range h.decimalBuckets[:] { if db == nil { continue @@ -76,6 +71,7 @@ func (h *Histogram) resetLocked() { h.lower = 0 h.upper = 0 h.sum = 0 + h.mu.Unlock() } // Update updates h with v.