Skip to content
Snippets Groups Projects
Commit 0f857400 authored by Evan Husted's avatar Evan Husted
Browse files

misc: chore: Use collection expressions in Common project

parent 95f9e548
No related branches found
No related tags found
No related merge requests found
......@@ -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()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment