Comments
5 comments
-
I've edited your post due to the obscenity included in it. Posting that sort of language in a public forum is unconstructive, especially when you are seeking technical help.
Any further posting with either a title or message content that includes offensive or abusive language will automatically be deleted from now on.
Someone will now look into your question and respond shortly,
Stephen -
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; }
-
I'm sorry for my offensive and abusive language, I thought that the decompiler was degraded deliberately. I wonder why neither devs nor lots of users noted that before me. I have one of the previous versions of .Net Reflector so why I can't use it? When I run it it says that the version is outdated and asks me for update, if I press the button "No" it just exits.
-
Turning optimisation to .Net 3.5 settles the matter. Thank you, Clive Tong.
-
Regarding the previous version exiting - Reflector has done this for years and performs the update.
You can read this blog post for more information:
http://www.simple-talk.com/community/bl ... 90624.aspx
Regards,
Stephen
Add comment
Please sign in to leave a comment.
How come this: if (num == 0 && !flag) turn into this: if (((num != null) ? 1 : flag) != null) ???