Refactor: Update variable declarations for consistency and clarity across multiple files

This commit is contained in:
Miha Kralj
2025-12-29 09:45:16 -08:00
parent 16a21a5b65
commit bfa92e554b
6 changed files with 17 additions and 19 deletions
+4 -4
View File
@@ -372,7 +372,7 @@ public class RingBufferTests
buffer.Add(20.0);
buffer.Add(30.0);
var values = new List<double>();
List<double> values = [];
foreach (var v in buffer)
{
values.Add(v);
@@ -395,7 +395,7 @@ public class RingBufferTests
buffer.Add(40.0);
buffer.Add(50.0);
var values = new List<double>();
List<double> values = [];
foreach (var v in buffer)
{
values.Add(v);
@@ -637,7 +637,7 @@ public class RingBufferTests
buffer.Add(20.0);
IEnumerable<double> enumerable = buffer;
var values = new List<double>();
List<double> values = [];
foreach (var v in enumerable)
{
values.Add(v);
@@ -656,7 +656,7 @@ public class RingBufferTests
buffer.Add(20.0);
IEnumerable enumerable = buffer;
var values = new List<double>();
List<double> values = [];
foreach (var v in enumerable)
{
values.Add((double)v);
+2 -2
View File
@@ -526,10 +526,10 @@ public sealed class RingBuffer : IEnumerable<double>
_index == other._index &&
_current.Equals(other._current);
public override readonly bool Equals(object? obj) =>
public readonly override bool Equals(object? obj) =>
obj is Enumerator other && Equals(other);
public override readonly int GetHashCode() =>
public readonly override int GetHashCode() =>
HashCode.Combine(RuntimeHelpers.GetHashCode(_buffer), _start, _count, _index, _current);
public static bool operator ==(Enumerator left, Enumerator right) => left.Equals(right);