private boolean removeNullEntry() { containsNull = false; key[n] = (0); size--; fixPointers(n); if (n > minN && size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return true; }
/** * Shifts left entries with the specified hash code, starting at the specified * position, and empties the resulting free entry. * * @param pos * a starting position. */ protected final void shiftKeys(int pos) { // Shift entries with the same hash. int last, slot; long curr; final long[] key = this.key; for (;;) { pos = ((last = pos) + 1) & mask; for (;;) { if (((curr = key[pos]) == (0))) { key[last] = (0); return; } slot = (int) it.unimi.dsi.fastutil.HashCommon.mix((curr)) & mask; if (last <= pos ? last >= slot || slot > pos : last >= slot && slot > pos) break; pos = (pos + 1) & mask; } key[last] = curr; fixPointers(pos, last); } } private boolean removeEntry(final int pos) {
private boolean removeEntry(final int pos) { size--; fixPointers(pos); shiftKeys(pos); if (n > minN && size < maxFill / 4 && n > DEFAULT_INITIAL_SIZE) rehash(n / 2); return true; } private boolean removeNullEntry() {
if (prev == pos) prev = last; fixPointers(pos, last);