From b1bcd8ea03b41692251aca8456cda80b07b5eec2 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Mon, 3 Jul 2023 01:26:14 +0200 Subject: [PATCH] MemoryBucket & OneSizeArrayPool made sealed for better performance. --- Recyclable.Collections/MemoryBucket.cs | 2 +- Recyclable.Collections/Pools/OneSizeArrayPool.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Recyclable.Collections/MemoryBucket.cs b/Recyclable.Collections/MemoryBucket.cs index e2e49e4..54a228a 100644 --- a/Recyclable.Collections/MemoryBucket.cs +++ b/Recyclable.Collections/MemoryBucket.cs @@ -1,6 +1,6 @@ namespace Recyclable.Collections { - internal class MemoryBucket + internal sealed class MemoryBucket { public MemoryBucket(T[] memory, MemoryBucket nextBucket) { diff --git a/Recyclable.Collections/Pools/OneSizeArrayPool.cs b/Recyclable.Collections/Pools/OneSizeArrayPool.cs index 11859c5..4434d63 100644 --- a/Recyclable.Collections/Pools/OneSizeArrayPool.cs +++ b/Recyclable.Collections/Pools/OneSizeArrayPool.cs @@ -2,7 +2,7 @@ namespace Recyclable.Collections.Pools { - public class OneSizeArrayPool : ArrayPool + public sealed class OneSizeArrayPool { private readonly int _blockSize; private readonly int _minBlockCount;