From 473a80ffcbe4b8f5a56ed890c804d06d0b562fc7 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 llvm-svn: 299293 --- llvm/include/llvm/ADT/APInt.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h index f2d4390a8117..402422507a57 100644 --- a/llvm/include/llvm/ADT/APInt.h +++ b/llvm/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; } /// @}