RoyGood`
2021-01-25 13:22关于HashMap源码中的removeTreeNode方法
final void removeTreeNode(HashMap<K,V> map, Node<K,V>[] tab,
boolean movable) {
int n;
if (tab == null || (n = tab.length) == 0)
return;
int index = (n - 1) & hash;
TreeNode<K,V> first = (TreeNode<K,V>)tab[index], root = first, rl;
TreeNode<K,V> succ = (TreeNode<K,V>)next, pred = prev;
if (pred == null)
tab[index] = first = succ;
else
pred.next = succ;
if (succ != null)
succ.prev = pred;
if (first == null)
return;
if (root.parent != null)
root = root.root();
代码太长,直到粘贴到的问题处
请问这个什么情况下会进入该条件
if (root.parent != null)
root = root.root();
提前感谢你的回答!
- 点赞
- 回答
- 收藏
- 复制链接分享
0条回答
为你推荐
- idea中service中的hashmap有个红框什么意思
- java
- intellij-idea
- java-ee
- spring
- 2个回答
- 【新手问题】在一个类中如何调用另一个类的某方法内的HashMap集合
- java
- c语言
- eclipse
- 2个回答
- 关于HashMap的put问题
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- 关于hashmap的问题
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- 【java】类封装和使用hashmap
- hashtable
- hashmap
- java
- class
- 3个回答
换一换