MCPcopy Create free account
hub / github.com/antlr/codebuff / rehashIfNecessary

Method rehashIfNecessary

output/java_guava/1.4.17/HashBiMap.java:327–340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

325 }
326
327 private void rehashIfNecessary() {
328 BiEntry<K, V>[] oldKToV = hashTableKToV;
329 if (Hashing.needsResizing(size, oldKToV.length, LOAD_FACTOR)) {
330 int newTableSize = oldKToV.length * 2;
331 this.hashTableKToV = createTable(newTableSize);
332 this.hashTableVToK = createTable(newTableSize);
333 this.mask = newTableSize - 1;
334 this.size = 0;
335 for (BiEntry<K, V> entry = firstInKeyInsertionOrder; entry != null; entry = entry.nextInKeyInsertionOrder) {
336 insert(entry, entry);
337 }
338 this.modCount++;
339 }
340 }
341
342 @SuppressWarnings("unchecked")
343 private BiEntry<K, V>[] createTable(int length) {

Callers 2

putMethod · 0.95
putInverseMethod · 0.95

Calls 3

needsResizingMethod · 0.95
createTableMethod · 0.95
insertMethod · 0.95

Tested by

no test coverage detected