Remove unnecessary checks.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 15 Feb 2007 19:18:12 +0000 (19:18 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 15 Feb 2007 19:18:12 +0000 (19:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34319 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/BitVector.h

index 0677b5449db46a102ae0cab5728c10b0adab66a4..d7284731173b1cb3c39dcd1fb76baf313873e50b 100644 (file)
@@ -179,10 +179,8 @@ public:
 
   // Set, reset, flip
   BitVector &set() {
-    if (Bits) {
-      init_words(Bits, Capacity, true);
-      clear_unused_bits();
-    }
+    init_words(Bits, Capacity, true);
+    clear_unused_bits();
     return *this;
   }
 
@@ -192,8 +190,7 @@ public:
   }
 
   BitVector &reset() {
-    if (Bits)
-      init_words(Bits, Capacity, false);
+    init_words(Bits, Capacity, false);
     return *this;
   }
 
@@ -317,14 +314,12 @@ private:
       std::copy(Bits, &Bits[OldCapacity], NewBits);
 
     // Destroy the old bits.
-    if (Bits)
-      delete[] Bits;
+    delete[] Bits;
     Bits = NewBits;
   }
 
   void init_words(BitWord *B, unsigned NumWords, bool t) {
-    if (B)
-      memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
+    memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
   } 
 };