Afirma + documentation +semver: patch

This commit is contained in:
Miha Kralj
2024-09-24 16:41:26 -07:00
parent 07efb4b0de
commit 133c65ceaf
250 changed files with 14425 additions and 713 deletions
+3 -11
View File
@@ -7,8 +7,8 @@ namespace QuanTAlib;
public class CircularBuffer : IEnumerable<double>
{
private readonly double[] _buffer;
private int _start;
private int _size;
private int _start = 0;
private int _size = 0;
public int Capacity { get; }
public int Count => _size;
@@ -69,9 +69,7 @@ public class CircularBuffer : IEnumerable<double>
public double Newest()
{
if (_size == 0)
{
return 0;
}
return _buffer[(_start + _size - 1) % Capacity];
}
@@ -79,9 +77,7 @@ public class CircularBuffer : IEnumerable<double>
public double Oldest()
{
if (_size == 0)
{
ThrowInvalidOperationException();
}
return _buffer[_start];
}
@@ -113,9 +109,7 @@ public class CircularBuffer : IEnumerable<double>
public bool MoveNext()
{
if (_index + 1 >= _buffer._size)
{
return false;
}
_index++;
_current = _buffer[_index];
@@ -131,9 +125,7 @@ public class CircularBuffer : IEnumerable<double>
_current = default;
}
public void Dispose() {
// not implemented
}
public void Dispose() { }
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]