今天开始写paser了,不过是从sharpdevelop借过来而已(不想重新发明轮子,^_^)。但是,还是对原先的代码作了一些修改,即使到了rc2了,sharpdevelop的代码中还是存在问题。今天看代码是就发现了两处。比如下面的代码:
static public int compare(ilist a, ilist b, icomparer comparer)
{
if (a == null || b == null) {
return 1;
}
if (a.count != b.count) {
return math.sign(a.count – b.count);
}
int limit = (a.count < b.count) ? a.count : b.count;
for(int i=0; i < limit; i++) {
if (a[i] is icomparable && b[i] is icomparable) {
int cmp = comparer.compare(a[i], b[i]);
if (cmp != 0) {
return cmp;
}
}
}
return a.count – b.count;
}
第二个if块让我迷惑了好一阵。看mono中已经纠正了,怀疑那段语句是不是在喝酒只有写的。
AOP C#在行动(续2)-.NET教程,C#语言
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » AOP C#在行动(续2)-.NET教程,C#语言
相关推荐
- 暂无文章
