From 8dfdc6f088a47cb95c05baa8bdf77dd3cc066281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Lema=C5=84czyk?= Date: Sat, 11 Mar 2023 16:43:14 +0100 Subject: [PATCH] Removed unnecessary Span creation in RecyclableList.AddRange(T[] items) & .AddRange(RecyclableArrayList items) --- Recyclable.Collections/RecyclableList.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index 03a5ae2..cce540b 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -294,7 +294,7 @@ namespace Recyclable.Collections } _nextItemIndex = itemsSpan.Length; - itemsSpan[..itemsSpan.Length].CopyTo(targetBlockArraySpan); + itemsSpan.CopyTo(targetBlockArraySpan); _longCount = targetCapacity; _lastBlockIndex = targetBlockIndex; } @@ -320,7 +320,7 @@ namespace Recyclable.Collections } _nextItemIndex = itemsSpan.Length; - itemsSpan[..itemsSpan.Length].CopyTo(targetBlockArraySpan); + itemsSpan.CopyTo(targetBlockArraySpan); _longCount = targetCapacity; _lastBlockIndex = targetBlockIndex; }