How can we help you today? How can we help you today?
Clive Tong
Hi. If you don't turn the optimization off, then the code is much more like you expected. What were you hoping to get out of the unoptimised code? It might be more informative to simply look at the IL. public static bool IsValidIdentifierName2(string name) { for (int i = 0; i < name.Length; i++) { UnicodeCategory unicodeCategory = char.GetUnicodeCategory(name[i]); bool flag = ((((unicodeCategory == UnicodeCategory.UppercaseLetter) || (unicodeCategory == UnicodeCategory.LetterNumber)) || ((unicodeCategory == UnicodeCategory.TitlecaseLetter) || (unicodeCategory == UnicodeCategory.OtherLetter))) || (unicodeCategory == UnicodeCategory.LetterNumber)) || (name[i] == '_'); bool flag2 = (((unicodeCategory == UnicodeCategory.NonSpacingMark) || (unicodeCategory == UnicodeCategory.SpacingCombiningMark)) || (unicodeCategory == UnicodeCategory.ModifierLetter)) || (unicodeCategory == UnicodeCategory.DecimalDigitNumber); if (!((i != 0) || flag)) { return false; } if (!(flag || flag2)) { return false; } } return true; } / comments
Hi. If you don't turn the optimization off, then the code is much more like you expected. What were you hoping to get out of the unoptimised code? It might be more informative to simply look at the...
0 votes
Hi. When I try the C# code you give, I only see expressions along the lines of int* numPtr = stackalloc int[20]; Can you send me an assembly containing code that generates the output you posted? Thanks / comments
Hi. When I try the C# code you give, I only see expressions along the lines of int* numPtr = stackalloc int[20]; Can you send me an assembly containing code that generates the output you posted? Th...
0 votes