Merge pull request #12 from yossiepon/fix/issue_11
[FIX] Cysharp/ObservableCollections#11
This commit is contained in:
commit
6d6aa74ff8
@ -49,7 +49,7 @@ namespace ObservableCollections.Internal
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var array = ArrayPool<T>.Shared.Rent(count);
|
var array = ArrayPool<T>.Shared.Rent(16);
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
foreach (var item in source)
|
foreach (var item in source)
|
||||||
@ -75,8 +75,8 @@ namespace ObservableCollections.Internal
|
|||||||
if (array.Length == index)
|
if (array.Length == index)
|
||||||
{
|
{
|
||||||
ArrayPool<T>.Shared.Return(array, RuntimeHelpersEx.IsReferenceOrContainsReferences<T>());
|
ArrayPool<T>.Shared.Return(array, RuntimeHelpersEx.IsReferenceOrContainsReferences<T>());
|
||||||
|
array = ArrayPool<T>.Shared.Rent(index * 2);
|
||||||
}
|
}
|
||||||
array = ArrayPool<T>.Shared.Rent(index * 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user