Skip to content

Commit 1d55ace

Browse files
committed
Make Settings parsers a readonly array
1 parent 16e9e55 commit 1d55ace

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Engine/Settings/Settings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static class Settings
3232
/// The first matching parser "wins" for auto discovery and presets when multiple
3333
/// files of the same base name, but different supported extensions, exist.
3434
/// </summary>
35-
private static readonly List<ISettingsParser> s_parsers = new()
35+
private static readonly ISettingsParser[] s_parsers =
3636
{
3737
new JsonSettingsParser(),
3838
new Psd1SettingsParser()
@@ -281,7 +281,7 @@ private static string ResolveProviderPathIfPossible(
281281
/// <exception cref="NotSupportedException">If no parser can handle the file.</exception>
282282
private static SettingsData ParseFile(string path)
283283
{
284-
var parser = s_parsers.Find(p => p.CanParse(path)) ??
284+
var parser = Array.Find(s_parsers, p => p.CanParse(path)) ??
285285
throw new NotSupportedException($"No parser registered for settings file '{path}'.");
286286
using var fs = File.OpenRead(path);
287287
var data = parser.Parse(fs, path);

0 commit comments

Comments
 (0)