There are only two distinct boolean values
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1391701 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2be663db75
commit
86226bb499
|
@ -5707,7 +5707,7 @@ public class ArrayUtils {
|
|||
if (isEmpty(array) || isEmpty(values)) {
|
||||
return clone(array);
|
||||
}
|
||||
HashMap<Boolean, MutableInt> occurrences = new HashMap<Boolean, MutableInt>(values.length);
|
||||
HashMap<Boolean, MutableInt> occurrences = new HashMap<Boolean, MutableInt>(2); // only two possible values here
|
||||
for (boolean v : values) {
|
||||
Boolean boxed = Boolean.valueOf(v);
|
||||
MutableInt count = occurrences.get(boxed);
|
||||
|
|
Loading…
Reference in New Issue