You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/04/13 05:13:50 UTC

[GitHub] [commons-math] arturobernalg opened a new pull request #177: MATH-1573 - Redundant local variable

arturobernalg opened a new pull request #177:
URL: https://github.com/apache/commons-math/pull/177


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] coveralls edited a comment on pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #177:
URL: https://github.com/apache/commons-math/pull/177#issuecomment-818578448


   
   [![Coverage Status](https://coveralls.io/builds/38773621/badge)](https://coveralls.io/builds/38773621)
   
   Coverage decreased (-0.02%) to 90.688% when pulling **495a8a22322aefbcad708592bfff4d41859fb0ad on arturobernalg:feature/MATH-1573** into **e29fd602381be65c0e2c2e4cd1e1c59bfa16c8bd on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] coveralls commented on pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #177:
URL: https://github.com/apache/commons-math/pull/177#issuecomment-818578448


   
   [![Coverage Status](https://coveralls.io/builds/38761307/badge)](https://coveralls.io/builds/38761307)
   
   Coverage decreased (-0.005%) to 90.695% when pulling **dd6cad94213a2430f5ea443e8e5d1d4c7116b8e8 on arturobernalg:feature/MATH-1573** into **26511237d21026623bc7ff26a1d2e90f16f21325 on apache:master**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] arturobernalg closed pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
arturobernalg closed pull request #177:
URL: https://github.com/apache/commons-math/pull/177


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] ebourg commented on a change in pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
ebourg commented on a change in pull request #177:
URL: https://github.com/apache/commons-math/pull/177#discussion_r612278410



##########
File path: src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java
##########
@@ -418,11 +418,10 @@ public double evaluate(final double[] values, final double mean,
                     accum += dev * dev;
                     accum2 += dev;
                 }
-                double len = length;

Review comment:
       `len` is a double but `length` is an int, I suspect it's preferable to cast only once here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] ebourg commented on a change in pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
ebourg commented on a change in pull request #177:
URL: https://github.com/apache/commons-math/pull/177#discussion_r612298980



##########
File path: src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
##########
@@ -163,14 +163,13 @@ public double kolmogorovSmirnovTest(ContinuousDistribution distribution, double[
     public double kolmogorovSmirnovStatistic(ContinuousDistribution distribution, double[] data) {
         checkArray(data);
         final int n = data.length;
-        final double nd = n;

Review comment:
       Same observation for the casting here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] arturobernalg commented on a change in pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #177:
URL: https://github.com/apache/commons-math/pull/177#discussion_r612395027



##########
File path: src/main/java/org/apache/commons/math4/util/FastMath.java
##########
@@ -674,8 +674,6 @@ public static double tanh(double x) {
           double yb = -(ya - hiPrec[0] - hiPrec[1]);
 
           /* Numerator */

Review comment:
       Changed

##########
File path: src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java
##########
@@ -165,17 +165,16 @@ public double evaluate(final double[] values, final int begin, final int length)
 
         if (MathArrays.verifyValues(values, begin, length)) {
             Sum sum = new Sum();
-            double sampleSize = length;

Review comment:
       Changed

##########
File path: src/main/java/org/apache/commons/math4/stat/descriptive/moment/Kurtosis.java
##########
@@ -183,12 +183,11 @@ public double evaluate(final double[] values, final int begin, final int length)
             accum3 /= FastMath.pow(stdDev, 4.0d);
 
             // Get N
-            double n0 = length;

Review comment:
       Changed

##########
File path: src/main/java/org/apache/commons/math4/stat/inference/KolmogorovSmirnovTest.java
##########
@@ -163,14 +163,13 @@ public double kolmogorovSmirnovTest(ContinuousDistribution distribution, double[
     public double kolmogorovSmirnovStatistic(ContinuousDistribution distribution, double[] data) {
         checkArray(data);
         final int n = data.length;
-        final double nd = n;

Review comment:
       Changed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] ebourg commented on a change in pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
ebourg commented on a change in pull request #177:
URL: https://github.com/apache/commons-math/pull/177#discussion_r612299213



##########
File path: src/main/java/org/apache/commons/math4/stat/descriptive/moment/Kurtosis.java
##########
@@ -183,12 +183,11 @@ public double evaluate(final double[] values, final int begin, final int length)
             accum3 /= FastMath.pow(stdDev, 4.0d);
 
             // Get N
-            double n0 = length;

Review comment:
       Same here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] arturobernalg commented on a change in pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
arturobernalg commented on a change in pull request #177:
URL: https://github.com/apache/commons-math/pull/177#discussion_r612285216



##########
File path: src/main/java/org/apache/commons/math4/stat/descriptive/moment/Variance.java
##########
@@ -418,11 +418,10 @@ public double evaluate(final double[] values, final double mean,
                     accum += dev * dev;
                     accum2 += dev;
                 }
-                double len = length;

Review comment:
       Hi @ebourg 
   sounds fair. Changed
   TY




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] ebourg commented on a change in pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
ebourg commented on a change in pull request #177:
URL: https://github.com/apache/commons-math/pull/177#discussion_r612303257



##########
File path: src/main/java/org/apache/commons/math4/util/FastMath.java
##########
@@ -674,8 +674,6 @@ public static double tanh(double x) {
           double yb = -(ya - hiPrec[0] - hiPrec[1]);
 
           /* Numerator */

Review comment:
       This comment should go away too




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [commons-math] ebourg commented on a change in pull request #177: MATH-1573 - Redundant local variable

Posted by GitBox <gi...@apache.org>.
ebourg commented on a change in pull request #177:
URL: https://github.com/apache/commons-math/pull/177#discussion_r612299375



##########
File path: src/main/java/org/apache/commons/math4/stat/descriptive/moment/Mean.java
##########
@@ -165,17 +165,16 @@ public double evaluate(final double[] values, final int begin, final int length)
 
         if (MathArrays.verifyValues(values, begin, length)) {
             Sum sum = new Sum();
-            double sampleSize = length;

Review comment:
       And here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org