This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch modularized_master
in repository https://gitbox.apache.org/repos/asf/commons-math.git


The following commit(s) were added to refs/heads/modularized_master by this 
push:
     new fcc47a2  Code reuse.
fcc47a2 is described below

commit fcc47a2c882d96ee5e635b0d27ba686e69da9e5b
Author: Gilles Sadowski <gillese...@gmail.com>
AuthorDate: Wed May 26 13:27:24 2021 +0200

    Code reuse.
---
 .../analysis/interpolation/LoessInterpolator.java     | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/LoessInterpolator.java
 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/LoessInterpolator.java
index 5ebfc69..37c2bd9 100644
--- 
a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/LoessInterpolator.java
+++ 
b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/interpolation/LoessInterpolator.java
@@ -228,9 +228,9 @@ public class LoessInterpolator
             throw new NoDataException();
         }
 
-        checkAllFiniteReal(xval);
-        checkAllFiniteReal(yval);
-        checkAllFiniteReal(weights);
+        NotFiniteNumberException.check(xval);
+        NotFiniteNumberException.check(yval);
+        NotFiniteNumberException.check(weights);
 
         MathArrays.checkOrder(xval);
 
@@ -458,17 +458,4 @@ public class LoessInterpolator
         final double tmp = 1 - absX * absX * absX;
         return tmp * tmp * tmp;
     }
-
-    /**
-     * Check that all elements of an array are finite real numbers.
-     *
-     * @param values Values array.
-     * @throws 
org.apache.commons.math4.legacy.exception.NotFiniteNumberException
-     * if one of the values is not a finite real number.
-     */
-    private static void checkAllFiniteReal(final double[] values) {
-        for (int i = 0; i < values.length; i++) {
-            NotFiniteNumberException.check(values[i]);
-        }
-    }
 }

Reply via email to