/** * {@inheritDoc} */ @Override public int removeAll(final BytePredicate predicate) { final int before = this.size(); if (this.allocatedDefaultKey) { if (predicate.apply(((byte)0))) { this.allocatedDefaultKey = false; } } final byte[] keys = ((this.keys)); for (int i = 0; i < keys.length;) { byte existing; if (!((existing = keys[i]) == (byte)0) && predicate.apply(existing)) { shiftConflictingKeys(i); // Shift, do not increment slot. } else { i++; } } return before - this.size(); }
/** * {@inheritDoc} */ @Override public int removeAll(final ByteLongPredicate predicate) { final int before = this.size(); if (this.allocatedDefaultKey) { if (predicate.apply(((byte)0), this.allocatedDefaultKeyValue)) { this.allocatedDefaultKey = false; } } final byte[] keys = ((this.keys)); final long[] values = ((this.values)); for (int i = 0; i < keys.length;) { byte existing; if (!((existing = keys[i]) == (byte)0) && predicate.apply(existing, values[i])) { shiftConflictingKeys(i); // Shift, do not increment slot. } else { i++; } } return before - this.size(); }
if (!((existing = keys[i]) == (byte)0) && other.contains(existing)) { shiftConflictingKeys(i);