commit | 33d1552f0140d207ba5ce5eab3eb7ec9b743ef28 | [log] [tgz] |
---|---|---|
author | Gilles Sadowski <gilles@harfang.homelinux.org> | Sat Jan 27 14:40:25 2018 +0100 |
committer | Gilles Sadowski <gilles@harfang.homelinux.org> | Sat Jan 27 14:40:25 2018 +0100 |
tree | df98afbc39498dd18ed03fcdf9314b2c4b1e5d7b | |
parent | 3eb53ba1748e680cdb94f515347ab3b762a59866 [diff] |
Unnecessary method calls.
diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java index 07b1fc6..7177308 100644 --- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java +++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java
@@ -103,9 +103,7 @@ */ @Override public double getMean() { - final double df = getDegreesOfFreedom(); - - if (df > 1) { + if (degreesOfFreedom > 1) { return 0; } @@ -125,13 +123,12 @@ */ @Override public double getVariance() { - final double df = getDegreesOfFreedom(); - - if (df > 2) { - return df / (df - 2); + if (degreesOfFreedom > 2) { + return degreesOfFreedom / (degreesOfFreedom - 2); } - if (df > 1 && df <= 2) { + if (degreesOfFreedom > 1 && + degreesOfFreedom <= 2) { return Double.POSITIVE_INFINITY; }