MCPcopy Index your code
hub / github.com/clojure/clojure / put

Method put

src/jvm/clojure/asm/SymbolTable.java:420–441  ·  view source on GitHub ↗

Puts the given entry in the #entries hash set. This method does not check whether #entries already contains a similar entry or not. #entries is resized if necessary to avoid hash collisions (multiple entries needing to be stored at the same #entries array index

(final Entry entry)

Source from the content-addressed store, hash-verified

418 * @return the given entry
419 */
420 private Entry put(final Entry entry) {
421 if (entryCount > (entries.length * 3) / 4) {
422 int currentCapacity = entries.length;
423 int newCapacity = currentCapacity * 2 + 1;
424 Entry[] newEntries = new Entry[newCapacity];
425 for (int i = currentCapacity - 1; i >= 0; --i) {
426 Entry currentEntry = entries[i];
427 while (currentEntry != null) {
428 int newCurrentEntryIndex = currentEntry.hashCode % newCapacity;
429 Entry nextEntry = currentEntry.next;
430 currentEntry.next = newEntries[newCurrentEntryIndex];
431 newEntries[newCurrentEntryIndex] = currentEntry;
432 currentEntry = nextEntry;
433 }
434 }
435 entries = newEntries;
436 }
437 entryCount++;
438 int index = entry.hashCode % entries.length;
439 entry.next = entries[index];
440 return entries[index] = entry;
441 }
442
443 /**
444 * Adds the given entry in the {@link #entries} hash set. This method does <i>not</i> check

Callers 11

addConstantIntegerMethod · 0.95
addConstantLongMethod · 0.95
addConstantUtf8Method · 0.95
addBootstrapMethodMethod · 0.95
addMergedTypeMethod · 0.95
addTypeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected