diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-10-06 20:21:23 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-10-06 20:21:23 +0200 |
| commit | a9a5fcde81060c9da2096235d61128006339a2ee (patch) | |
| tree | 3c3f7da26dffcc1a6589bcfc1cec2a5634e92c0e /MediaBrowser.LocalMetadata | |
| parent | 927fe33d3a0ec7f9e0fb568cfd423c6e8b966c9d (diff) | |
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);
```
Diffstat (limited to 'MediaBrowser.LocalMetadata')
| -rw-r--r-- | MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs b/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs index 777fe6774..a9e1b4a51 100644 --- a/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs +++ b/MediaBrowser.LocalMetadata/Parsers/BaseItemXmlParser.cs @@ -53,10 +53,7 @@ namespace MediaBrowser.LocalMetadata.Parsers /// <exception cref="ArgumentNullException">Item is null.</exception> public void Fetch(MetadataResult<T> item, string metadataFile, CancellationToken cancellationToken) { - if (item == null) - { - throw new ArgumentNullException(nameof(item)); - } + ArgumentNullException.ThrowIfNull(item); if (string.IsNullOrEmpty(metadataFile)) { |
