Safety assertions on head and tail modifications
This commit is contained in:
parent
818d217ede
commit
a556e31010
|
@ -604,6 +604,7 @@ public class Cache<K, V> {
|
|||
|
||||
if (before == null) {
|
||||
// removing the head
|
||||
assert head == entry;
|
||||
head = after;
|
||||
if (head != null) {
|
||||
head.before = null;
|
||||
|
@ -616,6 +617,7 @@ public class Cache<K, V> {
|
|||
|
||||
if (after == null) {
|
||||
// removing tail
|
||||
assert tail == entry;
|
||||
tail = before;
|
||||
if (tail != null) {
|
||||
tail.after = null;
|
||||
|
|
Loading…
Reference in New Issue