diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-05-05 12:51:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-05 13:51:14 +0200 |
| commit | 2e98de90628e9a4e42fb182f2d5a2a296acfd827 (patch) | |
| tree | d832ffcf9a40c734790c54854a3550f7f6ddb4e6 /Emby.Server.Implementations/ApplicationHost.cs | |
| parent | 04447ed0140810c01c017acd0c4e2aea33c2bf9b (diff) | |
Code Clean up: Convert to null-coalescing operator ?? (#5845)
Co-authored-by: Cody Robibero <cody@robibe.ro>
Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 703f8d20d..75d8fc113 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -335,10 +335,7 @@ namespace Emby.Server.Implementations { get { - if (_deviceId == null) - { - _deviceId = new DeviceId(ApplicationPaths, LoggerFactory); - } + _deviceId ??= new DeviceId(ApplicationPaths, LoggerFactory); return _deviceId.Value; } @@ -370,10 +367,7 @@ namespace Emby.Server.Implementations /// <returns>System.Object.</returns> protected object CreateInstanceSafe(Type type) { - if (_creatingInstances == null) - { - _creatingInstances = new List<Type>(); - } + _creatingInstances ??= new List<Type>(); if (_creatingInstances.IndexOf(type) != -1) { |
