Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. final V putVal(int hash, K key, V value, boolean onlyIfAbsent,
  2. boolean evict) {
  3. Node<K,V>[] tab; Node<K,V> p; int n, i;
  4. if ((tab = table) == null || (n = tab.length) == 0)
  5. //...
  6. if ((p = tab[i = (n - 1) & hash]) == null)
  7. //...
  8. else {
  9. Node<K,V> e; K k;
  10. if (p.hash == hash &&
  11. ((k = p.key) == key || (key != null && key.equals(k))))
  12. e = p;
  13. else if (p instanceof TreeNode)
  14. // ...
  15. else {
  16. for (int binCount = 0; ; ++binCount) {
  17. if ((e = p.next) == null) {
  18. p.next = newNode(hash, key, value, null);
  19. // ...
  20. }
  21. if (e.hash == hash &&
  22. ((k = e.key) == key || (key != null && key.equals(k))))
  23. break;
  24. p = e;
  25. }
  26. }
  27. if (e != null) { // existing mapping for key
  28. // ...
  29. }
  30. }
  31. ...
  32. return null;
  33. }
  34.  
  35. for (int binCount = 0; ; ++binCount) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement