aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2022-10-06 20:21:23 +0200
committerBond_009 <bond.009@outlook.com>2022-10-06 20:21:23 +0200
commita9a5fcde81060c9da2096235d61128006339a2ee (patch)
tree3c3f7da26dffcc1a6589bcfc1cec2a5634e92c0e /src
parent927fe33d3a0ec7f9e0fb568cfd423c6e8b966c9d (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 'src')
-rw-r--r--src/Jellyfin.Extensions/EnumerableExtensions.cs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Jellyfin.Extensions/EnumerableExtensions.cs b/src/Jellyfin.Extensions/EnumerableExtensions.cs
index b5fe93357..a31a57dc6 100644
--- a/src/Jellyfin.Extensions/EnumerableExtensions.cs
+++ b/src/Jellyfin.Extensions/EnumerableExtensions.cs
@@ -18,10 +18,7 @@ namespace Jellyfin.Extensions
/// <exception cref="ArgumentNullException">The source is null.</exception>
public static bool Contains(this IEnumerable<string> source, ReadOnlySpan<char> value, StringComparison stringComparison)
{
- if (source == null)
- {
- throw new ArgumentNullException(nameof(source));
- }
+ ArgumentNullException.ThrowIfNull(source);
if (source is IList<string> list)
{