From 528e50684d9c57d7733d60b84461babaee6c321b Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 18 Jun 2026 21:16:28 -0500 Subject: add Reset() --- src/slskd/Common/ExponentialMovingAverage.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/slskd/Common/ExponentialMovingAverage.cs b/src/slskd/Common/ExponentialMovingAverage.cs index aaa6e5ea..6bc773cb 100644 --- a/src/slskd/Common/ExponentialMovingAverage.cs +++ b/src/slskd/Common/ExponentialMovingAverage.cs @@ -72,6 +72,16 @@ namespace slskd private double SmoothingFactor { get; } private Action OnUpdate { get; } + /// + /// Resets the value. + /// + public void Reset() + { + Value = 0; + Initialized = false; + OnUpdate?.Invoke(Value); + } + /// /// Updates the average with a new value. /// -- cgit v1.2.3