mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-03-10 09:04:23 +00:00
misc: chore: Use collection expressions in Common project
This commit is contained in:
parent
95f9e548ca
commit
0f857400b6
@ -106,7 +106,7 @@ namespace Ryujinx.Common.Collections
|
||||
/// <returns>A list of all RangeNodes sorted by Key Order</returns>
|
||||
public List<RangeNode<TKey, TValue>> AsList()
|
||||
{
|
||||
List<RangeNode<TKey, TValue>> list = new();
|
||||
List<RangeNode<TKey, TValue>> list = [];
|
||||
|
||||
AddToList(Root, list);
|
||||
|
||||
|
@ -139,7 +139,7 @@ namespace Ryujinx.Common.Collections
|
||||
/// <param name="list">List to add the tree pairs into</param>
|
||||
public List<KeyValuePair<TKey, TValue>> AsLevelOrderList()
|
||||
{
|
||||
List<KeyValuePair<TKey, TValue>> list = new();
|
||||
List<KeyValuePair<TKey, TValue>> list = [];
|
||||
|
||||
Queue<Node<TKey, TValue>> nodes = new();
|
||||
|
||||
@ -168,7 +168,7 @@ namespace Ryujinx.Common.Collections
|
||||
/// <returns>A list of all KeyValuePairs sorted by Key Order</returns>
|
||||
public List<KeyValuePair<TKey, TValue>> AsList()
|
||||
{
|
||||
List<KeyValuePair<TKey, TValue>> list = new();
|
||||
List<KeyValuePair<TKey, TValue>> list = [];
|
||||
|
||||
AddToList(Root, list);
|
||||
|
||||
|
@ -8,7 +8,7 @@ namespace Ryujinx.Common.Configuration
|
||||
|
||||
public ModMetadata()
|
||||
{
|
||||
Mods = new List<Mod>();
|
||||
Mods = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ namespace Ryujinx.Common.Logging
|
||||
_enabledClasses[index] = true;
|
||||
}
|
||||
|
||||
_logTargets = new List<ILogTarget>();
|
||||
_logTargets = [];
|
||||
|
||||
_time = Stopwatch.StartNew();
|
||||
|
||||
@ -203,7 +203,7 @@ namespace Ryujinx.Common.Logging
|
||||
|
||||
public static IReadOnlyCollection<LogLevel> GetEnabledLevels()
|
||||
{
|
||||
Log?[] logs = new[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace };
|
||||
Log?[] logs = [Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace];
|
||||
List<LogLevel> levels = new(logs.Length);
|
||||
foreach (Log? log in logs)
|
||||
{
|
||||
|
@ -125,8 +125,8 @@ namespace Ryujinx.Common.PreciseSleep
|
||||
}
|
||||
|
||||
private readonly Lock _lock = new();
|
||||
private readonly List<NanosleepThread> _threads = new();
|
||||
private readonly List<NanosleepThread> _active = new();
|
||||
private readonly List<NanosleepThread> _threads = [];
|
||||
private readonly List<NanosleepThread> _active = [];
|
||||
private readonly Stack<NanosleepThread> _free = new();
|
||||
private readonly AutoResetEvent _signalTarget;
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace Ryujinx.Common.SystemInterop
|
||||
private long _lastId;
|
||||
|
||||
private readonly Lock _lock = new();
|
||||
private readonly List<WaitingObject> _waitingObjects = new();
|
||||
private readonly List<WaitingObject> _waitingObjects = [];
|
||||
|
||||
private WindowsGranularTimer()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user