diff --git a/.editorconfig b/.editorconfig index 276b98b0..b50a63d6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,6 +14,10 @@ insert_final_newline = true # High-performance SIMD code intentionally has complex control flow dotnet_diagnostic.S3776.severity = none +# Suppress SonarQube S1244 - Floating point equality +# Intentional for exact struct comparison and zero checks in high-performance code +dotnet_diagnostic.S1244.severity = none + #### C# Coding Conventions #### # "var" preferences diff --git a/lib/core/tbar/tbar.cs b/lib/core/tbar/tbar.cs index 0175fedf..d2a42720 100644 --- a/lib/core/tbar/tbar.cs +++ b/lib/core/tbar/tbar.cs @@ -67,7 +67,6 @@ public readonly struct TBar : IEquatable [MethodImpl(MethodImplOptions.AggressiveInlining)] public override string ToString() => $"[{AsDateTime:yyyy-MM-dd HH:mm:ss}: O={Open:F2}, H={High:F2}, L={Low:F2}, C={Close:F2}, V={Volume:F2}]"; -#pragma warning disable S1244 // Floating point equality is intentional for exact struct comparison [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(TBar other) => Time == other.Time && @@ -81,5 +80,4 @@ public readonly struct TBar : IEquatable public override int GetHashCode() => HashCode.Combine(Time, Open, High, Low, Close, Volume); public static bool operator ==(TBar left, TBar right) => left.Equals(right); public static bool operator !=(TBar left, TBar right) => !left.Equals(right); -#pragma warning restore S1244 }