forked from Speiger/Primitive-Collections
Fixed small logic error in clearAndTrim (Maps/Sets)
This commit is contained in:
parent
29f2b8e305
commit
212f532350
|
@ -426,7 +426,7 @@ public class LINKED_CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends CUSTOM_HASH_M
|
|||
@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;
|
||||
}
|
||||
|
|
|
@ -535,7 +535,7 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
|
|||
@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;
|
||||
}
|
||||
|
|
|
@ -406,7 +406,7 @@ public class LINKED_HASH_MAP KEY_VALUE_GENERIC_TYPE extends HASH_MAP KEY_VALUE_G
|
|||
@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;
|
||||
}
|
||||
|
|
|
@ -496,7 +496,7 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
|
|||
@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;
|
||||
}
|
||||
|
|
|
@ -506,7 +506,7 @@ public class LINKED_CUSTOM_HASH_SET KEY_GENERIC_TYPE extends CUSTOM_HASH_SET KEY
|
|||
@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;
|
||||
}
|
||||
|
|
|
@ -487,7 +487,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
|||
@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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue