fix CloneCollection

This commit is contained in:
prozolic 2024-06-02 20:16:10 +09:00
parent e34d0231c6
commit 53b58f9827

View File

@ -74,8 +74,10 @@ namespace ObservableCollections.Internal
{
if (array.Length == index)
{
var newArray = ArrayPool<T>.Shared.Rent(index * 2);
Array.Copy(array, newArray, index);
ArrayPool<T>.Shared.Return(array, RuntimeHelpersEx.IsReferenceOrContainsReferences<T>());
array = ArrayPool<T>.Shared.Rent(index * 2);
array = newArray;
}
}