public long sum() {
Cell[] as = cells; Cell a;
long sum = base;
if (as != null) {
for (int i = 0; i < as.length; ++i) {
if ((a = as[i]) != null)
sum += a.value;
}
}
return sum;
}
在调用sum()的时候,如果是还没有遍历到的Cell[]槽被修改了而不是已经遍历的槽被修改,那不会影响最终的结果正确性了吗?
登录后可查看更多问答,登录/注册