Only clear the map if there are entries at all.

This commit is contained in:
asofold 2016-06-11 12:29:09 +02:00
parent 1e3620ac38
commit 57cb4580f9
1 changed files with 4 additions and 2 deletions

View File

@ -229,8 +229,10 @@ public abstract class AbstractCoordHashMap<V, E extends fr.neatmonster.nocheatpl
@Override
public void clear() {
size = 0;
Arrays.fill(entries, null);
if (size > 0) {
size = 0;
Arrays.fill(entries, null);
}
// TODO: resize ?
}