mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-24 02:07:11 +02:00
misc: Code cleanups & remove references to Patreon & Twitter.
This commit is contained in:
parent
26e9aa11d5
commit
4c237c4793
27 changed files with 91 additions and 307 deletions
|
@ -3,19 +3,11 @@ using System.Threading;
|
|||
|
||||
namespace Ryujinx.Common
|
||||
{
|
||||
public class ObjectPool<T>
|
||||
public class ObjectPool<T>(Func<T> factory, int size)
|
||||
where T : class
|
||||
{
|
||||
private T _firstItem;
|
||||
private readonly T[] _items;
|
||||
|
||||
private readonly Func<T> _factory;
|
||||
|
||||
public ObjectPool(Func<T> factory, int size)
|
||||
{
|
||||
_items = new T[size - 1];
|
||||
_factory = factory;
|
||||
}
|
||||
private readonly T[] _items = new T[size - 1];
|
||||
|
||||
public T Allocate()
|
||||
{
|
||||
|
@ -43,7 +35,7 @@ namespace Ryujinx.Common
|
|||
}
|
||||
}
|
||||
|
||||
return _factory();
|
||||
return factory();
|
||||
}
|
||||
|
||||
public void Release(T obj)
|
||||
|
|
|
@ -47,15 +47,9 @@ namespace Ryujinx.Common
|
|||
}
|
||||
}
|
||||
|
||||
public class ReactiveEventArgs<T>
|
||||
public class ReactiveEventArgs<T>(T oldValue, T newValue)
|
||||
{
|
||||
public T OldValue { get; }
|
||||
public T NewValue { get; }
|
||||
|
||||
public ReactiveEventArgs(T oldValue, T newValue)
|
||||
{
|
||||
OldValue = oldValue;
|
||||
NewValue = newValue;
|
||||
}
|
||||
public T OldValue { get; } = oldValue;
|
||||
public T NewValue { get; } = newValue;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue