From 4f75c097b05b8eaf704ed679b18d5a54f2e63476 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 23 Mar 2015 19:45:40 +0000 Subject: [PATCH] Refactor: Simplify boolean expressions in llvm Support Simplify boolean expressions using `true` and `false` with `clang-tidy` Patch by Richard Thomson - I dropped the parens and != 0 test, for consistency with other patches/tests like this, but I'm open to the notion that we should add the explicit non-zero test in all these sort of cases (non-bool assigned to a bool). Differential Revision: http://reviews.llvm.org/D8526 llvm-svn: 233004 --- llvm/lib/Support/APFloat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index 535e80d..f3f0198 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -1430,7 +1430,7 @@ APFloat::addOrSubtractSignificand(const APFloat &rhs, bool subtract) /* Determine if the operation on the absolute values is effectively an addition or subtraction. */ - subtract ^= (sign ^ rhs.sign) ? true : false; + subtract ^= sign ^ rhs.sign; /* Are we bigger exponent-wise than the RHS? */ bits = exponent - rhs.exponent; -- 2.7.4