@SuppressWarnings("unchecked") public void remove() { if (last == -1) throw new IllegalStateException(); if (pos < -1) { // We're removing wrapped entries. Int2DoubleOpenHashMap.this.remove(wrapped.getInt(-pos - 2)); last = -1; return; } size--; if (shiftKeys(last) == pos && c > 0) { c++; nextEntry(); } last = -1; // You can no longer remove this entry. if (ASSERTS) checkTable(); }
public int nextEntry() { if (!hasNext()) throw new NoSuchElementException(); c--; // We are just enumerating elements from the wrapped list. if (pos < 0) { final int k = wrapped.getInt(-(last = --pos) - 2); // The starting point. int pos = (it.unimi.dsi.fastutil.HashCommon.murmurHash3((k))) & mask; // There's always an unused entry. while (used[pos]) { if (((key[pos]) == (k))) return pos; pos = (pos + 1) & mask; } } last = pos; // System.err.println( "Count: " + c ); if (c != 0) { final boolean used[] = Int2DoubleOpenHashMap.this.used; while (pos-- != 0 && !used[pos]) ; // When here pos < 0 there are no more elements to be enumerated by scanning, but wrapped // might be nonempty. } return last; }