Enhance coding conventions and static analysis setup; update .editorconfig, scanner.sh, and various C# files for improved readability and performance

This commit is contained in:
Miha Kralj
2025-12-04 14:36:00 -08:00
parent 967096d4f5
commit ee358bfdd9
9 changed files with 31 additions and 4 deletions
+3
View File
@@ -1,3 +1,4 @@
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -300,6 +301,7 @@ public sealed class Sma
}
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
#pragma warning disable S6640 // Unsafe code is required for high-performance SIMD operations
private static unsafe void CalculateSimdCore(ReadOnlySpan<double> source, Span<double> output, int period)
{
int len = source.Length;
@@ -370,6 +372,7 @@ public sealed class Sma
}
}
}
#pragma warning restore S6640
/// <summary>
/// Checks if span contains any non-finite values (NaN or Infinity).
+3
View File
@@ -1,3 +1,4 @@
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -285,6 +286,7 @@ public sealed class Wma
}
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
#pragma warning disable S6640 // Unsafe code is required for high-performance SIMD operations
private static unsafe void CalculateSimdCore(ReadOnlySpan<double> source, Span<double> output, int period)
{
int len = source.Length;
@@ -466,6 +468,7 @@ public sealed class Wma
}
}
}
#pragma warning restore S6640
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static bool HasNonFiniteValues(ReadOnlySpan<double> span)