File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22// Licensed under the Six Labors Split License.
33
44using System . Diagnostics ;
5+ using System . Diagnostics . CodeAnalysis ;
56using System . Runtime . CompilerServices ;
67
78namespace SixLabors ;
@@ -22,14 +23,9 @@ internal static partial class DebugGuard
2223 /// <typeparam name="TValue">The type of the value.</typeparam>
2324 /// <exception cref="ArgumentNullException"><paramref name="value"/> is null.</exception>
2425 [ Conditional ( "DEBUG" ) ]
25- public static void NotNull < TValue > ( TValue value , string parameterName )
26- where TValue : class
27- {
28- if ( value is null )
29- {
30- ThrowArgumentNullException ( parameterName ) ;
31- }
32- }
26+ public static void NotNull < TValue > ( [ NotNull ] TValue ? value , string parameterName )
27+ where TValue : class =>
28+ ArgumentNullException . ThrowIfNull ( value , parameterName ) ;
3329
3430 /// <summary>
3531 /// Ensures that the target value is not null, empty, or whitespace.
You can’t perform that action at this time.
0 commit comments