File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 2
2
// Licensed under the Six Labors Split License.
3
3
4
4
using System . Diagnostics ;
5
+ using System . Diagnostics . CodeAnalysis ;
5
6
using System . Runtime . CompilerServices ;
6
7
7
8
namespace SixLabors ;
@@ -20,16 +21,9 @@ internal static partial class Guard
20
21
/// <typeparam name="TValue">The type of the value.</typeparam>
21
22
/// <exception cref="ArgumentNullException"><paramref name="value"/> is null.</exception>
22
23
[ 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 ) ;
33
27
34
28
/// <summary>
35
29
/// Ensures that the target value is not null, empty, or whitespace.
You can’t perform that action at this time.
0 commit comments