My friend came across an interesting source code of two methods in String.cs:
[TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public static bool operator ==(string a, string b) { return Equals(a, b); } [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")] public static bool Equals(string a, string b) { return ((a == b) || (((a != null) && (b != null)) && EqualsHelper(a, b))); }
Why does this not lead to an infinite loop? (and all of our programs will be aborted with a StackOverflowException!)
source share