我正在查看 YUI Compressor并在 ECMA.NET 项目中遇到了这段代码(如果您有兴趣,请继续阅读文件)。
protected internal override int FindPrototypeId (string s)
{
int id;
#region Generated PrototypeId Switch
L0: {
id = 0;
string X = null;
if (s.Length == 11) { X = "constructor"; id = Id_constructor; }
if (X != null && X != s && !X.Equals (s))
id = 0;
}
EL0:
#endregion
return id;
}
我不知道 L0: 和 EL0: 在这里做什么,以前从未见过。这个术语对于谷歌来说似乎也太初级了。
有人知道吗?
最佳答案
它们看起来像用作 goto 目标的标签。参见 http://msdn.microsoft.com/en-us/library/13940fs2.aspx获取更多信息。
关于c# - C# 中的代码好奇心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/727469/