标签:图解 code bool 原理 table class pre alt nsf
void transfer(Entry[] newTable, boolean rehash) {
int newCapacity = newTable.length;
for (Entry<K,V> e : table) {
while(null != e) {
Entry<K,V> next = e.next;
if (rehash) { //jdk8中无此判断
e.hash = null == e.key ? 0 : hash(e.key);
}
int i = indexFor(e.hash, newCapacity);
e.next = newTable[i];
newTable[i] = e;
e = next;
}
}
}
标签:图解 code bool 原理 table class pre alt nsf
原文地址:https://www.cnblogs.com/boluopabo/p/12950348.html