private void chainedTrimToSize(ChainedBucket bucket, int oldIndex, int mask) { do { this.addForTrim(bucket.zero, oldIndex, mask); if (bucket.one == null) { return; } this.addForTrim(bucket.one, oldIndex, mask); if (bucket.two == null) { return; } this.addForTrim(bucket.two, oldIndex, mask); if (bucket.three == null) { return; } if (bucket.three instanceof ChainedBucket) { bucket = (ChainedBucket) bucket.three; continue; } this.addForTrim(bucket.three, oldIndex, mask); return; } while (true); }
private void chainedTrimToSize(ChainedBucket bucket, int oldIndex, int mask) { do { this.addForTrim(bucket.zero, oldIndex, mask); if (bucket.one == null) { return; } this.addForTrim(bucket.one, oldIndex, mask); if (bucket.two == null) { return; } this.addForTrim(bucket.two, oldIndex, mask); if (bucket.three == null) { return; } if (bucket.three instanceof ChainedBucket) { bucket = (ChainedBucket) bucket.three; continue; } this.addForTrim(bucket.three, oldIndex, mask); return; } while (true); }
public boolean trimToSize() { if (this.table.length <= (this.fastCeil(this.occupied / this.loadFactor) << 1)) { return false; } Object[] temp = this.table; this.init(this.fastCeil(this.occupied / this.loadFactor)); if (this.isEmpty()) { return true; } int mask = this.table.length - 1; for (int j = 0; j < temp.length; j++) { Object cur = temp[j]; if (cur instanceof ChainedBucket) { ChainedBucket bucket = (ChainedBucket) cur; this.chainedTrimToSize(bucket, j, mask); } else if (cur != null) { this.addForTrim(cur, j, mask); } } return true; }
public boolean trimToSize() { if (this.table.length <= (this.fastCeil(this.occupied / this.loadFactor) << 1)) { return false; } Object[] temp = this.table; this.init(this.fastCeil(this.occupied / this.loadFactor)); if (this.isEmpty()) { return true; } int mask = this.table.length - 1; for (int j = 0; j < temp.length; j++) { Object cur = temp[j]; if (cur instanceof ChainedBucket) { ChainedBucket bucket = (ChainedBucket) cur; this.chainedTrimToSize(bucket, j, mask); } else if (cur != null) { this.addForTrim(cur, j, mask); } } return true; }
private void chainedTrimToSize(ChainedBucket bucket, int oldIndex, int mask) { do { this.addForTrim((T) bucket.zero, oldIndex, mask); if (bucket.one == null) { return; } this.addForTrim((T) bucket.one, oldIndex, mask); if (bucket.two == null) { return; } this.addForTrim((T) bucket.two, oldIndex, mask); if (bucket.three == null) { return; } if (bucket.three instanceof ChainedBucket) { bucket = (ChainedBucket) bucket.three; continue; } this.addForTrim((T) bucket.three, oldIndex, mask); return; } while (true); }
public boolean trimToSize() { if (this.table.length <= (this.fastCeil(this.occupied / this.loadFactor) << 1)) { return false; } Object[] temp = this.table; this.init(this.fastCeil(this.occupied / this.loadFactor)); if (this.isEmpty()) { return true; } int mask = this.table.length - 1; for (int j = 0; j < temp.length; j++) { Object cur = temp[j]; if (cur instanceof ChainedBucket) { ChainedBucket bucket = (ChainedBucket) cur; this.chainedTrimToSize(bucket, j, mask); } else if (cur != null) { this.addForTrim(cur, j, mask); } } return true; }