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

Cache simplification

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