Simplifying for loop

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@770101 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2009-04-30 07:50:19 +00:00
parent c58bbaaa4b
commit f89a50b528
1 changed files with 2 additions and 2 deletions

View File

@ -896,10 +896,10 @@ public class BooleanUtils {
// Loops through array, comparing each item
int trueCount = 0;
for (int i = 0; i < array.length; i++) {
for (boolean element : array) {
// If item is true, and trueCount is < 1, increments count
// Else, xor fails
if (array[i]) {
if (element) {
if (trueCount < 1) {
trueCount++;
} else {