Fixed small logic error in clearAndTrim (Maps/Sets)
This commit is contained in:
1 parent
29f2b8e305
commit
212f532350
8 files changed
+8
-8
No files matched your search
+1
-1
@@ -355,7 +355,7 @@ public class CUSTOM_HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_T
|
||||
@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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user