mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 06:18:28 +01:00
Use ArgumentNullException.ThrowIfNull helper method
Did a simple search/replace on the whole repo (except the RSSDP project)
This reduces LOC and should improve performance (methods containing a throw statement don't get inlined)
```
if \((\w+) == null\)
\s+\{
\s+throw new ArgumentNullException\((.*)\);
\s+\}
```
```
ArgumentNullException.ThrowIfNull($1);
```
This commit is contained in:
@@ -1188,10 +1188,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
|
||||
internal IChannel GetChannelProvider(Channel channel)
|
||||
{
|
||||
if (channel == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(channel));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(channel);
|
||||
|
||||
var result = GetAllChannels()
|
||||
.FirstOrDefault(i => GetInternalChannelId(i.Name).Equals(channel.ChannelId) || string.Equals(i.Name, channel.Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
Reference in New Issue
Block a user