1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-29 06:41:32 +08:00

Merge pull request #1473 from nicollcheng/patch-1

更新链表树化条件
This commit is contained in:
Guide哥 2021-12-16 21:34:34 +08:00 committed by GitHub
commit 96497efacb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -541,7 +541,7 @@ final V putVal(K key, V value, boolean onlyIfAbsent) {
5. 如果都不满足,则利用 synchronized 锁写入数据。
6. 如果数量大于 `TREEIFY_THRESHOLD` 则要转换为红黑树。
6. 如果数量大于 `TREEIFY_THRESHOLD` 则要执行树化方法在treeifyBin中会首先判断当前数组长度≥64时才会将链表转换为红黑树。
### 4. get