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)