From 86f5387b55f8c90700f55e9794ddf748603554e3 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sun, 25 Jun 2023 19:50:39 +0200 Subject: [PATCH] Tiny performance improvement until the stack is redesigned. --- Recyclable.Collections/RecyclableStack.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Recyclable.Collections/RecyclableStack.cs b/Recyclable.Collections/RecyclableStack.cs index b885708..b8a2a2a 100644 --- a/Recyclable.Collections/RecyclableStack.cs +++ b/Recyclable.Collections/RecyclableStack.cs @@ -8,13 +8,12 @@ namespace Recyclable.Collections private readonly int _blockSize; protected RecyclableLongList List { get; } - public int Count => List.Count; + public int Count => checked((int)List._longCount); public long LongCount { - get => List.LongCount; - set => List.LongCount = value; + get => List._longCount; + set => List._longCount = value; } - public bool IsReadOnly => List.IsReadOnly; public T this[int index] { get => this[(long)index]; set => this[(long)index] = value; }