MCPcopy Create free account
hub / github.com/ReadyTalk/avian / remove

Method remove

classpath/java/util/HashMap.java:115–131  ·  view source on GitHub ↗
(Cell<K, V> cell)

Source from the content-addressed store, hash-verified

113 }
114
115 public void remove(Cell<K, V> cell) {
116 int index = cell.hashCode() & (array.length - 1);
117 Cell<K, V> p = null;
118 for (Cell<K, V> c = array[index]; c != null; c = c.next()) {
119 if (c == cell) {
120 if (p == null) {
121 array[index] = c.next();
122 } else {
123 p.setNext(c.next());
124 }
125 -- size;
126 break;
127 }
128 }
129
130 shrink();
131 }
132
133 private Cell<K, V> putCell(K key, V value) {
134 Cell<K, V> c = find(key);

Callers 1

testHashMapMethod · 0.95

Calls 6

shrinkMethod · 0.95
removeCellMethod · 0.95
hashCodeMethod · 0.65
nextMethod · 0.65
setNextMethod · 0.65
getValueMethod · 0.65

Tested by 1

testHashMapMethod · 0.76