提交 7528244f authored 作者: Thomas Mueller's avatar Thomas Mueller

Cache simplification

上级 e91be706
......@@ -294,25 +294,13 @@ public class CacheLRU implements Cache {
// if(Database.CHECK) {
// testConsistency();
// }
// TODO cache: should probably use the LRU list
ObjectArray<CacheObject> list = ObjectArray.newInstance();
for (int i = 0; i < len; i++) {
CacheObject rec = values[i];
while (rec != null) {
if (rec.isChanged()) {
list.add(rec);
if (list.size() >= recordCount) {
if (SysProperties.CHECK) {
if (list.size() > recordCount) {
Message.throwInternalError("cache chain error");
}
} else {
break;
}
}
}
rec = rec.chained;
CacheObject rec = head.next;
while (rec != head) {
if (rec.isChanged()) {
list.add(rec);
}
rec = rec.next;
}
return list;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论