Fixed small logic error in clearAndTrim (Maps/Sets)

This commit is contained in:
2021-09-13 17:15:40 +02:00
parent 29f2b8e305
commit 212f532350
8 changed files with 8 additions and 8 deletions
@@ -313,7 +313,7 @@ public class HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE imp
@Override
public void clearAndTrim(int size) {
int request = Math.max(minCapacity, HashUtil.nextPowerOfTwo((int)Math.ceil(size / loadFactor)));
if(size >= request) {
if(request >= size) {
clear();
return;
}