fix: initialize average cache state with cleared values
All checks were successful
Release Tag / release (push) Successful in 9s

This commit is contained in:
2025-01-22 18:25:16 -06:00
parent 08b8d0ce3d
commit b7652ed7cc

View File

@@ -14,11 +14,15 @@ type AvgCacheState struct {
// New creates a new average cache state with the given size.
func New(size int) *AvgCacheState {
return &AvgCacheState{
a := &AvgCacheState{
size: size,
avgs: make([]cachestate.CacheState, size),
mu: sync.Mutex{},
}
a.Clear()
return a
}
// Clear resets the average cache state to zero.