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 ;
@@ -20,16 +21,9 @@ internal static partial class Guard
2021 /// <typeparam name="TValue">The type of the value.</typeparam>
2122 /// <exception cref="ArgumentNullException"><paramref name="value"/> is null.</exception>
2223 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
23- public static void NotNull < TValue > ( TValue value , string parameterName )
24- where TValue : class
25- {
26- if ( value is not null )
27- {
28- return ;
29- }
30-
31- ThrowHelper . ThrowArgumentNullExceptionForNotNull ( parameterName ) ;
32- }
24+ public static void NotNull < TValue > ( [ NotNull ] TValue ? value , string parameterName )
25+ where TValue : class =>
26+ ArgumentNullException . ThrowIfNull ( value , parameterName ) ;
3327
3428 /// <summary>
3529 /// Ensures that the target value is not null, empty, or whitespace.
You can’t perform that action at this time.
0 commit comments