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 <gil...@harfang.homelinux.org> Authored: Tue Jan 30 15:45:33 2018 +0100 Committer: Gilles Sadowski <gil...@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; } }