You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2018/02/01 14:09:02 UTC

[10/14] commons-numbers git commit: Unnecessary instantiation.

Unnecessary instantiation.


Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/2af72846
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/2af72846
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/2af72846

Branch: refs/heads/master
Commit: 2af72846f1b96315804a320f6fd95bcd5458a547
Parents: 49ed2b8
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Thu Feb 1 13:11:37 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Thu Feb 1 13:11:37 2018 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/commons/numbers/complex/Complex.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/2af72846/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
----------------------------------------------------------------------
diff --git a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
index d474c31..ca0eea8 100644
--- a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
+++ b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
@@ -1086,7 +1086,7 @@ public class Complex implements Serializable  {
     public Complex sqrt() {
         if (real == 0 &&
             imaginary == 0) {
-            return new Complex(0, 0);
+            return ZERO;
         } else if (neitherInfiniteNorZeroNorNaN(real) &&
                    imaginary == Double.POSITIVE_INFINITY) {
             return new Complex(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);