diff --git a/docs/src/sidebar/sanfene/collection.md b/docs/src/sidebar/sanfene/collection.md index be0f3faa2..8658dd061 100644 --- a/docs/src/sidebar/sanfene/collection.md +++ b/docs/src/sidebar/sanfene/collection.md @@ -998,7 +998,7 @@ if (hiHead != null) ![三分恶面渣逆袭:扩容节点迁移示意图](https://cdn.tobebetterjavaer.com/tobebetterjavaer/images/sidebar/sanfene/collection-27.png) -#### 扩容的时候每个节点都要进行位运算吗? +#### 扩容的时候每个节点都会移动吗? 不需要。HashMap 会通过 `(e.hash & oldCap)` 来判断节点是否需要移动,0 的话保留原索引;1 才需要移动到新索引(原索引 + oldCap)。 @@ -1348,4 +1348,4 @@ _没有什么使我停留——除了目的,纵然岸旁有玫瑰、有绿荫 - [面渣逆袭分布式篇 👍](https://javabetter.cn/sidebar/sanfene/fenbushi.html) - [面渣逆袭微服务篇 👍](https://javabetter.cn/sidebar/sanfene/weifuwu.html) - [面渣逆袭设计模式篇 👍](https://javabetter.cn/sidebar/sanfene/shejimoshi.html) -- [面渣逆袭 Linux 篇 👍](https://javabetter.cn/sidebar/sanfene/linux.html) \ No newline at end of file +- [面渣逆袭 Linux 篇 👍](https://javabetter.cn/sidebar/sanfene/linux.html)