Add quick range check in CharNormalizer

This commit is contained in:
MihaZupan
2021-03-14 04:10:58 +01:00
parent c964659085
commit 63fddf4511

View File

@@ -20,7 +20,7 @@ namespace Markdig.Helpers
/// <returns>The simple ASCII string or null if the char itself cannot be simplified</returns>
public static string? ConvertToAscii(char c)
{
return CodeToAscii.TryGetValue(c, out string? str) ? str : null;
return c >= 160 && CodeToAscii.TryGetValue(c, out string? str) ? str : null;
}
static CharNormalizer()