Skip to content

Commit a963444

Browse files
committed
Use EmptyString again for checks
1 parent b09309a commit a963444

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Shared/ThrowHelpers/ArgumentThrowHelper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ namespace Microsoft.AspNetCore.Shared;
1111

1212
internal static partial class ArgumentThrowHelper
1313
{
14+
#if !NET7_0_OR_GREATER || NETSTANDARD || NETFRAMEWORK
15+
private const string EmptyString = "";
16+
#endif
17+
1418
/// <summary>Throws an <see cref="ArgumentNullException"/> if <paramref name="argument"/> is null or an <see cref="ArgumentException"/> if it is empty.</summary>
1519
/// <param name="argument">The reference type argument to validate as neither null nor empty.</param>
1620
/// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
@@ -21,7 +25,7 @@ public static void ThrowIfNullOrEmpty(
2125
string? argument, [CallerArgumentExpression("argument")] string? paramName = null)
2226
{
2327
#if !NET7_0_OR_GREATER || NETSTANDARD || NETFRAMEWORK
24-
if (argument is null or argument == string.Empty)
28+
if (argument is null or EmptyString)
2529
{
2630
ArgumentNullThrowHelper.ThrowIfNull(argument);
2731
Throw(paramName);

0 commit comments

Comments
 (0)