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:
Sebastian Bazley 2012-09-28 23:59:55 +00:00
parent 2be663db75
commit 86226bb499
1 changed files with 1 additions and 1 deletions

View File

@ -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);