mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-06 18:50:54 +01:00
Ensure minimal capacity for CoordMap (not relevant to known issues).
This commit is contained in:
parent
2c73a8adb8
commit
44b6eb2b2a
@ -276,7 +276,7 @@ public class CoordMap<V> {
|
|||||||
|
|
||||||
private final void resize(final int size) {
|
private final void resize(final int size) {
|
||||||
// TODO: other capacity / allow to set strategy [also for reducing for long time use]
|
// TODO: other capacity / allow to set strategy [also for reducing for long time use]
|
||||||
final int newCapacity = Math.max((int) ((size + 4) / loadFactor), entries.length + entries.length / 4);
|
final int newCapacity = Math.min(Math.max((int) ((size + 4) / loadFactor), entries.length + entries.length / 4), 4);
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
final List<Entry<V>>[] newEntries = new List[newCapacity];
|
final List<Entry<V>>[] newEntries = new List[newCapacity];
|
||||||
int used = -1; // Fill old buckets to fornt of old array.
|
int used = -1; // Fill old buckets to fornt of old array.
|
||||||
|
Loading…
Reference in New Issue
Block a user