Skip to content

Commit 2838f8b

Browse files
committed
Replace null checks with IsEmpty property for ReadOnlySpan<char>
This change suppresses CA2265 warnings.
1 parent cd7b9ca commit 2838f8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Markdig/Helpers/LinkHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ public static string Urilize(ReadOnlySpan<char> headingText, bool allowOnlyAscii
6060
}
6161
else
6262
{
63-
normalized = allowOnlyAscii ? CharNormalizer.ConvertToAscii(c) : null;
63+
normalized = allowOnlyAscii ? CharNormalizer.ConvertToAscii(c) : ReadOnlySpan<char>.Empty;
6464
}
6565

6666
for (int j = 0; j < (normalized.Length < 1 ? 1 : normalized.Length); j++)
6767
{
68-
if (normalized != null)
68+
if (!normalized.IsEmpty)
6969
{
7070
c = normalized[j];
7171
}

0 commit comments

Comments
 (0)