mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-08 22:17:44 +00:00
Squash
dotcover s1 .sln s1 s1 s2 s3 s4 s5 s1 s2 x x2 x3 x4 x5 x6 x1 sonarcube cleanup1 sonarcube cleanup2 sonarcube cleanup 3 fixes q q q q q q q q q1 q2 q q1 codacy 1
This commit is contained in:
@@ -7,8 +7,8 @@ namespace QuanTAlib;
|
||||
public class CircularBuffer : IEnumerable<double>
|
||||
{
|
||||
private readonly double[] _buffer;
|
||||
private int _start = 0;
|
||||
private int _size = 0;
|
||||
private int _start;
|
||||
private int _size;
|
||||
|
||||
public int Capacity { get; }
|
||||
public int Count => _size;
|
||||
@@ -69,7 +69,9 @@ public class CircularBuffer : IEnumerable<double>
|
||||
public double Newest()
|
||||
{
|
||||
if (_size == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return _buffer[(_start + _size - 1) % Capacity];
|
||||
}
|
||||
|
||||
@@ -109,7 +111,9 @@ public class CircularBuffer : IEnumerable<double>
|
||||
public bool MoveNext()
|
||||
{
|
||||
if (_index + 1 >= _buffer._size)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
_index++;
|
||||
_current = _buffer[_index];
|
||||
|
||||
Reference in New Issue
Block a user