clean code fixes

This commit is contained in:
Miha Kralj
2024-10-06 17:16:47 -07:00
parent bcac34bf09
commit b7b5a4a1bf
52 changed files with 787 additions and 643 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ public class Max : AbstractBase
/// <exception cref="ArgumentOutOfRangeException">
/// Thrown when the period is less than 1 or decay is negative.
/// </exception>
public Max(int period, double decay = 0) : base()
public Max(int period, double decay = 0)
{
if (period < 1)
{
@@ -105,7 +105,7 @@ public class Max : AbstractBase
}
double decayRate = 1 - Math.Exp(-_halfLife * _timeSinceNewMax / Period);
_currentMax = _currentMax - decayRate * (_currentMax - _buffer.Average());
_currentMax -= decayRate * (_currentMax - _buffer.Average());
_currentMax = Math.Min(_currentMax, _buffer.Max());
IsHot = true;