[llvm] r299320 - [APInt] Use conditional operator to simplify some code. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 1 14:50:11 PDT 2017


Author: ctopper
Date: Sat Apr  1 16:50:10 2017
New Revision: 299320

URL: http://llvm.org/viewvc/llvm-project?rev=299320&view=rev
Log:
[APInt] Use conditional operator to simplify some code. NFC

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

Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=299320&r1=299319&r2=299320&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Sat Apr  1 16:50:10 2017
@@ -2819,10 +2819,7 @@ int APInt::tcCompare(const integerPart *
     if (lhs[parts] == rhs[parts])
       continue;
 
-    if (lhs[parts] > rhs[parts])
-      return 1;
-    else
-      return -1;
+    return (lhs[parts] > rhs[parts]) ? 1 : -1;
   }
 
   return 0;




More information about the llvm-commits mailing list