diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-04-30 21:32:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-30 13:32:59 -0600 |
| commit | 3feb3f81bfe848aa829e7c129bee3cd060c23c05 (patch) | |
| tree | c247db8e30d1cc52bc6735d45d86eff8955ee7e9 /Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs | |
| parent | 5dc6bb4910cfdc7f40ad83d647172d743e6e0595 (diff) | |
More efficient array creation (#11468)
Diffstat (limited to 'Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index a2f38c8c2..9e98d5ce0 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -127,15 +127,11 @@ namespace Emby.Server.Implementations.AppBase if (_configurationFactories is null) { - _configurationFactories = new[] { factory }; + _configurationFactories = [factory]; } else { - var oldLen = _configurationFactories.Length; - var arr = new IConfigurationFactory[oldLen + 1]; - _configurationFactories.CopyTo(arr, 0); - arr[oldLen] = factory; - _configurationFactories = arr; + _configurationFactories = [.._configurationFactories, factory]; } _configurationStores = _configurationFactories |
