Skip to content

Commit be55c43

Browse files
committed
concurrencyHashMap源码分析错别字勘误
1 parent 71be325 commit be55c43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/java/collection/concurrent-hash-map-source-code.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ private void rehash(HashEntry<K,V> node) {
328328
HashEntry<K,V> e = oldTable[i];
329329
if (e != null) {
330330
HashEntry<K,V> next = e.next;
331-
// 计算新的位置,新的位置只可能是不便或者是老的位置+老的容量。
331+
// 计算新的位置,新的位置只可能是不变或者是老的位置+老的容量。
332332
int idx = e.hash & sizeMask;
333333
if (next == null) // Single node on list
334334
// 如果当前位置还不是链表,只是一个元素,直接赋值
@@ -337,7 +337,7 @@ private void rehash(HashEntry<K,V> node) {
337337
// 如果是链表了
338338
HashEntry<K,V> lastRun = e;
339339
int lastIdx = idx;
340-
// 新的位置只可能是不便或者是老的位置+老的容量。
340+
// 新的位置只可能是不变或者是老的位置+老的容量。
341341
// 遍历结束后,lastRun 后面的元素位置都是相同的
342342
for (HashEntry<K,V> last = next; last != null; last = last.next) {
343343
int k = last.hash & sizeMask;

0 commit comments

Comments
 (0)