[llvm] r233004 - Refactor: Simplify boolean expressions in llvm Support

David Blaikie dblaikie at gmail.com
Mon Mar 23 12:45:40 PDT 2015


Author: dblaikie
Date: Mon Mar 23 14:45:40 2015
New Revision: 233004

URL: http://llvm.org/viewvc/llvm-project?rev=233004&view=rev
Log:
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

Modified:
    llvm/trunk/lib/Support/APFloat.cpp

Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=233004&r1=233003&r2=233004&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Mon Mar 23 14:45:40 2015
@@ -1430,7 +1430,7 @@ APFloat::addOrSubtractSignificand(const
 
   /* 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;





More information about the llvm-commits mailing list