Today began to write Paser, but borrowed from SharpDevelop (do not want to reinvent the wheel, ^_^). However, there are some changes to the original code, even if the RC2, the SharpDevelop code is still a problem. Looking at the code today is the discovery of two places. For example, the following code:
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;
}
The second if block puzzled me for a while. Look at the mono has been corrected, doubt that paragraph is not drinking only write.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service