File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
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 ;
@@ -22,14 +23,9 @@ internal static partial class DebugGuard
22
23
/// <typeparam name="TValue">The type of the value.</typeparam>
23
24
/// <exception cref="ArgumentNullException"><paramref name="value"/> is null.</exception>
24
25
[ 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 ) ;
33
29
34
30
/// <summary>
35
31
/// Ensures that the target value is not null, empty, or whitespace.
You can’t perform that action at this time.
0 commit comments