From 8ade2f5a5d7bfdf682c2325832274561f697fff2 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Wed, 29 May 2024 11:37:29 +0200 Subject: [PATCH] Addressed some warnings --- FastRng/MultiChannelRng.cs | 2 ++ FastRng/MultiThreadedRng.cs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/FastRng/MultiChannelRng.cs b/FastRng/MultiChannelRng.cs index f4e0b9b..2eaa0b5 100644 --- a/FastRng/MultiChannelRng.cs +++ b/FastRng/MultiChannelRng.cs @@ -4,6 +4,8 @@ using System.Numerics; using System.Threading; using System.Threading.Channels; +// ReSharper disable RedundantExtendsListEntry + namespace FastRng; public sealed class MultiChannelRng : IRandom, IDisposable where TNum : IFloatingPointIeee754, IAdditionOperators diff --git a/FastRng/MultiThreadedRng.cs b/FastRng/MultiThreadedRng.cs index 77e94e2..e7fbfba 100644 --- a/FastRng/MultiThreadedRng.cs +++ b/FastRng/MultiThreadedRng.cs @@ -5,6 +5,8 @@ using System.Numerics; using System.Threading; using System.Threading.Tasks; +// ReSharper disable RedundantExtendsListEntry + namespace FastRng; /// @@ -37,7 +39,10 @@ public sealed class MultiThreadedRng : IRandom, IDisposable where TN private const int QUEUE_SIZE_INT = QUEUE_SIZE_FLOAT * 2; private static readonly TNum CONST_FLOAT_CONVERSION = TNum.CreateChecked(2.328306435454494e-10f); + + // ReSharper disable StaticMemberInGenericType private static readonly object LOCKER = new(); + // ReSharper restore StaticMemberInGenericType // Gets used to stop the producer threads: private readonly CancellationTokenSource producerTokenSource = new(); @@ -197,7 +202,7 @@ public sealed class MultiThreadedRng : IRandom, IDisposable where TN while (!cancellationToken.IsCancellationRequested) { // A local source buffer of uints: - uint[] bufferSource = null; + uint[] bufferSource; // Try to get the next source buffer: while (!this.queueIntegers.TryDequeue(out bufferSource) && !cancellationToken.IsCancellationRequested)