diff --git a/Recyclable.Collections.Benchmarks/POC/RecyclableListPoc.Benchmarks.EnsureCapacity.cs b/Recyclable.Collections.Benchmarks/POC/RecyclableListPoc.Benchmarks.EnsureCapacity.cs index 5f4ebe2..da5f07c 100644 --- a/Recyclable.Collections.Benchmarks/POC/RecyclableListPoc.Benchmarks.EnsureCapacity.cs +++ b/Recyclable.Collections.Benchmarks/POC/RecyclableListPoc.Benchmarks.EnsureCapacity.cs @@ -498,7 +498,7 @@ namespace Recyclable.Collections.Benchmarks.POC targetBlockIndex = _nextItemBlockIndex, memoryBlockCount = _memoryBlocks.Length; - Span itemsSpan = new(items.AsArray(), 0, items.Count); + Span itemsSpan = new(items.AsArray, 0, items.Count); Span memoryBlocksSpan = new(_memoryBlocks, 0, memoryBlockCount); Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], _nextItemIndex, blockSize - _nextItemIndex); while (targetBlockArraySpan.Length <= itemsSpan.Length) @@ -1397,7 +1397,7 @@ namespace Recyclable.Collections.Benchmarks.POC targetBlockIndex = _nextItemBlockIndex, memoryBlockCount = _memoryBlocks.Length; - Span itemsSpan = new(items.AsArray(), 0, items.Count); + Span itemsSpan = new(items.AsArray, 0, items.Count); Span memoryBlocksSpan = new(_memoryBlocks, 0, memoryBlockCount); Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], _nextItemIndex, blockSize - _nextItemIndex); while (targetBlockArraySpan.Length <= itemsSpan.Length) diff --git a/Recyclable.Collections/RecyclableArrayList.cs b/Recyclable.Collections/RecyclableArrayList.cs index 155e7a1..8160579 100644 --- a/Recyclable.Collections/RecyclableArrayList.cs +++ b/Recyclable.Collections/RecyclableArrayList.cs @@ -368,7 +368,7 @@ namespace Recyclable.Collections _count = targetItemIdx; } - public T[] AsArray() => _memoryBlock; + public T[] AsArray => _memoryBlock; public void Clear() { diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index 9f2527d..eaa3de5 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -681,7 +681,7 @@ namespace Recyclable.Collections targetBlockIndex = _nextItemBlockIndex, memoryBlockCount = _reservedBlockCount; - Span itemsSpan = new(items.AsArray(), 0, items.Count); + Span itemsSpan = new(items.AsArray, 0, items.Count); Span memoryBlocksSpan = new(_memoryBlocks, 0, memoryBlockCount); Span targetBlockArraySpan = new(memoryBlocksSpan[targetBlockIndex], _nextItemIndex, blockSize - _nextItemIndex); while (targetBlockArraySpan.Length <= itemsSpan.Length)