From ff4a4b66831fd824e6fa8797bd27461851ec943d Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sat, 15 Jul 2023 17:41:27 +0200 Subject: [PATCH] Fix to avoid exception when the target is smaller, if the no. of items on the list is smaller than capacity. --- Recyclable.CollectionsTests/CustomIList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Recyclable.CollectionsTests/CustomIList.cs b/Recyclable.CollectionsTests/CustomIList.cs index 6d191b8..81acead 100644 --- a/Recyclable.CollectionsTests/CustomIList.cs +++ b/Recyclable.CollectionsTests/CustomIList.cs @@ -22,7 +22,7 @@ namespace Recyclable.CollectionsTests public void Add(T item) => _list.Add(item); public void Clear() => _list.Clear(); public bool Contains(T item) => _list.Contains(item); - public void CopyTo(T[] array, int arrayIndex) => _list.CopyTo(array, arrayIndex); + public void CopyTo(T[] array, int arrayIndex) => _list.CopyTo(0, array, arrayIndex, _list.Count); public IEnumerator GetEnumerator() => _list.GetEnumerator(); public int IndexOf(T item) => _list.IndexOf(item); public void Insert(int index, T item) => _list.Insert(index, item);