From 290906a752f98cdd678516f04d09467c24ce2608 Mon Sep 17 00:00:00 2001 From: Stefan Nikolei Date: Fri, 1 Dec 2023 16:29:53 +0100 Subject: [PATCH] Fix CA1513 --- .../Allocators/Internals/SharedArrayPoolBuffer{T}.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ImageSharp/Memory/Allocators/Internals/SharedArrayPoolBuffer{T}.cs b/src/ImageSharp/Memory/Allocators/Internals/SharedArrayPoolBuffer{T}.cs index c0a0c5d272..02bdf0f48d 100644 --- a/src/ImageSharp/Memory/Allocators/Internals/SharedArrayPoolBuffer{T}.cs +++ b/src/ImageSharp/Memory/Allocators/Internals/SharedArrayPoolBuffer{T}.cs @@ -57,15 +57,7 @@ internal class SharedArrayPoolBuffer : ManagedBufferBase, IRefCounted [Conditional("DEBUG")] [MemberNotNull(nameof(Array))] - private void CheckDisposed() - { -#pragma warning disable CA1513 - if (this.Array == null) - { - throw new ObjectDisposedException("SharedArrayPoolBuffer"); - } -#pragma warning restore CA1513 - } + private void CheckDisposed() => ObjectDisposedException.ThrowIf(this.Array == null, this.Array); private sealed class LifetimeGuard : RefCountedMemoryLifetimeGuard {