diff options
Diffstat (limited to 'src/Ryujinx.Common/Pools')
| -rw-r--r-- | src/Ryujinx.Common/Pools/ObjectPool.cs | 2 | ||||
| -rw-r--r-- | src/Ryujinx.Common/Pools/SharedPools.cs | 2 | ||||
| -rw-r--r-- | src/Ryujinx.Common/Pools/ThreadStaticArray.cs | 5 |
3 files changed, 3 insertions, 6 deletions
diff --git a/src/Ryujinx.Common/Pools/ObjectPool.cs b/src/Ryujinx.Common/Pools/ObjectPool.cs index e0bf5df6..a0d3feb9 100644 --- a/src/Ryujinx.Common/Pools/ObjectPool.cs +++ b/src/Ryujinx.Common/Pools/ObjectPool.cs @@ -13,7 +13,7 @@ namespace Ryujinx.Common public ObjectPool(Func<T> factory, int size) { - _items = new T[size - 1]; + _items = new T[size - 1]; _factory = factory; } diff --git a/src/Ryujinx.Common/Pools/SharedPools.cs b/src/Ryujinx.Common/Pools/SharedPools.cs index b4860b85..272a7418 100644 --- a/src/Ryujinx.Common/Pools/SharedPools.cs +++ b/src/Ryujinx.Common/Pools/SharedPools.cs @@ -5,7 +5,7 @@ private static class DefaultPool<T> where T : class, new() { - public static readonly ObjectPool<T> Instance = new ObjectPool<T>(() => new T(), 20); + public static readonly ObjectPool<T> Instance = new(() => new T(), 20); } public static ObjectPool<T> Default<T>() diff --git a/src/Ryujinx.Common/Pools/ThreadStaticArray.cs b/src/Ryujinx.Common/Pools/ThreadStaticArray.cs index 21434a02..54df5041 100644 --- a/src/Ryujinx.Common/Pools/ThreadStaticArray.cs +++ b/src/Ryujinx.Common/Pools/ThreadStaticArray.cs @@ -9,10 +9,7 @@ namespace Ryujinx.Common.Pools public static ref T[] Get() { - if (_array == null) - { - _array = new T[1]; - } + _array ??= new T[1]; return ref _array; } |
