Skip to content

Commit 1523b58

Browse files
committed
Removed leftover compiler directives
1 parent a2dcde9 commit 1523b58

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

Microsoft.Toolkit/Diagnostics/Guard.String.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
#if NETSTANDARD2_1
76
using System.Diagnostics.CodeAnalysis;
8-
#endif
97
using System.Runtime.CompilerServices;
108

119
#nullable enable
@@ -39,11 +37,7 @@ public static void IsNullOrEmpty(string? text, string name)
3937
/// <param name="name">The name of the input parameter being tested.</param>
4038
/// <exception cref="ArgumentException">Thrown if <paramref name="text"/> is <see langword="null"/> or empty.</exception>
4139
[MethodImpl(MethodImplOptions.AggressiveInlining)]
42-
public static void IsNotNullOrEmpty(
43-
#if NETSTANDARD2_1
44-
[NotNull]
45-
#endif
46-
string? text, string name)
40+
public static void IsNotNullOrEmpty([NotNull] string? text, string name)
4741
{
4842
if (string.IsNullOrEmpty(text))
4943
{
@@ -73,11 +67,7 @@ public static void IsNullOrWhitespace(string? text, string name)
7367
/// <param name="name">The name of the input parameter being tested.</param>
7468
/// <exception cref="ArgumentException">Thrown if <paramref name="text"/> is <see langword="null"/> or whitespace.</exception>
7569
[MethodImpl(MethodImplOptions.AggressiveInlining)]
76-
public static void IsNotNullOrWhitespace(
77-
#if NETSTANDARD2_1
78-
[NotNull]
79-
#endif
80-
string? text, string name)
70+
public static void IsNotNullOrWhitespace([NotNull] string? text, string name)
8171
{
8272
if (string.IsNullOrWhiteSpace(text))
8373
{

Microsoft.Toolkit/Diagnostics/Guard.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@ public static void IsNotNull<T>([NotNull] T? value, string name)
7878
/// <exception cref="ArgumentNullException">Thrown if <paramref name="value"/> is <see langword="null"/>.</exception>
7979
/// <remarks>The method is generic to avoid boxing the parameters, if they are value types.</remarks>
8080
[MethodImpl(MethodImplOptions.AggressiveInlining)]
81-
public static void IsNotNull<T>(
82-
#if NETSTANDARD2_1
83-
[NotNull]
84-
#endif
85-
T? value, string name)
81+
public static void IsNotNull<T>([NotNull] T? value, string name)
8682
where T : struct
8783
{
8884
if (value is null)

0 commit comments

Comments
 (0)