diff --git a/src/main/java/org/apache/commons/math4/dfp/Dfp.java b/src/main/java/org/apache/commons/math4/dfp/Dfp.java index de1d4a010..841ec2f32 100644 --- a/src/main/java/org/apache/commons/math4/dfp/Dfp.java +++ b/src/main/java/org/apache/commons/math4/dfp/Dfp.java @@ -1830,6 +1830,7 @@ public class Dfp implements RealFieldElement { for (int i = mant.length - 1; i >= 0; i--) { if (divisor.mant[i] > remainder[i]) { trialgood = true; + break; } if (divisor.mant[i] < remainder[i]) { break; diff --git a/src/main/java/org/apache/commons/math4/optim/BaseMultiStartMultivariateOptimizer.java b/src/main/java/org/apache/commons/math4/optim/BaseMultiStartMultivariateOptimizer.java index 937ff50e3..f411a181a 100644 --- a/src/main/java/org/apache/commons/math4/optim/BaseMultiStartMultivariateOptimizer.java +++ b/src/main/java/org/apache/commons/math4/optim/BaseMultiStartMultivariateOptimizer.java @@ -190,6 +190,7 @@ public abstract class BaseMultiStartMultivariateOptimizer if ((min != null && s[k] < min[k]) || (max != null && s[k] > max[k])) { // reject the vector s = null; + break; } } } diff --git a/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java b/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java index 7fc823d3c..a002f9cbb 100644 --- a/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java +++ b/src/main/java/org/apache/commons/math4/stat/regression/SimpleRegression.java @@ -300,10 +300,11 @@ public class SimpleRegression implements Serializable, UpdatingMultipleLinearReg (x == null) ? 0 : x.length, (y == null) ? 0 : y.length); } - boolean obsOk=true; + boolean obsOk = true; for( int i = 0 ; i < x.length; i++){ if( x[i] == null || x[i].length == 0 ){ obsOk = false; + break; } } if( !obsOk ){