diff --git a/Projects/Server/Buffers/CircularBuffer.cs b/Projects/Server/Buffers/CircularBuffer.cs index c8e146e3c..18ad4ae73 100644 --- a/Projects/Server/Buffers/CircularBuffer.cs +++ b/Projects/Server/Buffers/CircularBuffer.cs @@ -42,7 +42,7 @@ namespace System.Buffers throw new ArgumentOutOfRangeException(nameof(index)); } - return index < _first.Length ? _first[index] : _second[_first.Length - index]; + return index < _first.Length ? _first[index] : _second[index - _first.Length]; } set { @@ -57,7 +57,7 @@ namespace System.Buffers } else { - _second[_first.Length - index] = value; + _second[index - _first.Length] = value; } } }