fix: Prepares for IPooledEnumerable removal (#1548)
### Summary - Removes `IPooledEnumerable` (non-generic) - Changes `IPooledEnumerable<T>` so that `Free()` is replaced with the `IDisposable` pattern
This commit is contained in:
parent
c2d6578955
commit
d57f1fecc1
92 changed files with 644 additions and 907 deletions
|
|
@ -997,6 +997,17 @@ public static class Utility
|
|||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void Shuffle<T>(this PooledRefList<T> list)
|
||||
{
|
||||
var count = list.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var r = RandomMinMax(i, count - 1);
|
||||
(list[r], list[i]) = (list[i], list[r]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a random sample from the source list.
|
||||
* Not meant for unbounded lists. Does not shuffle or modify source.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue