多回报声明STRANGE?

Bur*_*imi 5 c# decompiling return

今天在玩De-compiler时,我对.NET C#Char类进行了反编译,并且有一个我不理解的奇怪案例

public static bool IsDigit(char c)
{
    if (char.IsLatin1(c) || c >= 48)
    {
        return c <= 57;
    }
    return false;
    return CharUnicodeInfo.GetUnicodeCategory(c) == 8;//Is this Line Reachable if Yes How does it work !
}
Run Code Online (Sandbox Code Playgroud)

我使用Telerik JustDecompile

MrK*_*ins 3

认为你的反编译器可能很狡猾......使用 Reflector 我得到:

public static bool IsDigit(char c)
{
   if (!IsLatin1(c))
   {
       return (CharUnicodeInfo.GetUnicodeCategory(c) == UnicodeCategory.DecimalDigitNumber);
   }
   return ((c >= '0') && (c <= '9'));
}
Run Code Online (Sandbox Code Playgroud)

通过 ILSpy 我得到:

public static bool IsDigit(char c)
{
   if (char.IsLatin1(c))
   {
      return c >= '0' && c <= '9';
   }
   return CharUnicodeInfo.GetUnicodeCategory(c) == UnicodeCategory.DecimalDigitNumber;
}
Run Code Online (Sandbox Code Playgroud)