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:
Bond_009
2022-10-06 20:21:23 +02:00
parent 927fe33d3a
commit a9a5fcde81
60 changed files with 155 additions and 617 deletions

View File

@@ -160,10 +160,7 @@ namespace MediaBrowser.Common.Net
/// <inheritdoc/>
public override bool Contains(IPAddress address)
{
if (address == null)
{
throw new ArgumentNullException(nameof(address));
}
ArgumentNullException.ThrowIfNull(address);
if (address.IsIPv4MappedToIPv6)
{