mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-03 22:40:09 +00: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:
parent
927fe33d3a
commit
a9a5fcde81
60 changed files with 155 additions and 617 deletions
|
|
@ -5105,15 +5105,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
MediaSourceInfo mediaSource,
|
||||
string requestedUrl)
|
||||
{
|
||||
if (state == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(state));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(state);
|
||||
|
||||
if (mediaSource == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(mediaSource));
|
||||
}
|
||||
ArgumentNullException.ThrowIfNull(mediaSource);
|
||||
|
||||
var path = mediaSource.Path;
|
||||
var protocol = mediaSource.Protocol;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue