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:
parent
c58bbaaa4b
commit
f89a50b528
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue