From ea476cb4cb3b3e2d2cfb3af252f538def317d31e Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 1 Apr 2017 06:50:00 +0000 Subject: [PATCH] [APInt] Implement operator! using operator==(uint64_t). NFCI git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299293 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/APInt.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index f2d4390a811..402422507a5 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -627,13 +627,7 @@ public: /// /// \returns true if *this is zero, false otherwise. bool operator!() const { - if (isSingleWord()) - return !VAL; - - for (unsigned i = 0; i != getNumWords(); ++i) - if (pVal[i]) - return false; - return true; + return *this == 0; } /// @}