trivial optimization
authorChris Lattner <sabre@nondot.org>
Wed, 4 Apr 2007 06:18:21 +0000 (06:18 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 4 Apr 2007 06:18:21 +0000 (06:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35648 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/APInt.h

index df90753f636c28e59352f27519c722a489e7b661..d80c601d274909a9775538a67a89930bb12bf948 100644 (file)
@@ -278,7 +278,7 @@ public:
   /// This converts the APInt to a boolean value as a test against zero.
   /// @brief Boolean conversion function. 
   inline bool getBoolValue() const {
-    return countLeadingZeros() != BitWidth;
+    return *this != 0;
   }
 
   /// @}