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/02 13:29:13 UTC

[18/50] commons-numbers git commit: Unnecessary branching.

Unnecessary branching.


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

Branch: refs/heads/feature__NUMBERS-51__field
Commit: 2e07396d80cdd9ee2d7c824bbd5e6b321234cbfa
Parents: 3f3b7ad
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
Authored: Tue Jan 30 15:45:33 2018 +0100
Committer: Gilles Sadowski <gi...@harfang.homelinux.org>
Committed: Tue Jan 30 15:45:33 2018 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/commons/numbers/complex/Complex.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/2e07396d/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 b1e7f50..60e85c8 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
@@ -1308,8 +1308,8 @@ public class Complex implements Serializable  {
      * {@code false} otherwise.
      */
     private static boolean neitherInfiniteNorZeroNorNaN(double d) {
-        if (!Double.isNaN(d) && !Double.isInfinite(d) && d != 0) {
-            return true;
-        } else return false;
+        return !Double.isNaN(d) &&
+            !Double.isInfinite(d) &&
+            d != 0;
     }
 }