This commit is contained in:
yossiepon 2022-08-25 19:50:34 +09:00
parent 58af49bad1
commit 973bee3081

View File

@ -49,7 +49,7 @@ namespace ObservableCollections.Internal
}
else
{
var array = ArrayPool<T>.Shared.Rent(count);
var array = ArrayPool<T>.Shared.Rent(16);
var i = 0;
foreach (var item in source)
@ -75,9 +75,9 @@ namespace ObservableCollections.Internal
if (array.Length == index)
{
ArrayPool<T>.Shared.Return(array, RuntimeHelpersEx.IsReferenceOrContainsReferences<T>());
}
array = ArrayPool<T>.Shared.Rent(index * 2);
}
}
public void Dispose()
{