Merges two resize() variants.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 15 Feb 2007 19:12:39 +0000 (19:12 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 15 Feb 2007 19:12:39 +0000 (19:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34316 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/BitVector.h

index 6910be04e510ee913f79998ea9b3cf55199ec35a..bbbb179ee4d2c65fdceb1939963602311871fe29 100644 (file)
@@ -161,23 +161,15 @@ public:
   }
 
   /// resize - Grow or shrink the bitvector.
-  void resize(unsigned N) {
-    if (N > Capacity * BITS_PER_WORD) {
-      unsigned OldCapacity = Capacity;
-      grow(N);
-      init_words(&Bits[OldCapacity], (Capacity-OldCapacity), false);
-    }
-    Size = N;
-  }
-
-  void resize(unsigned N, bool t) {
+  void resize(unsigned N, bool t = false) {
     if (N > Capacity * BITS_PER_WORD) {
       unsigned OldCapacity = Capacity;
       grow(N);
       init_words(&Bits[OldCapacity], (Capacity-OldCapacity), t);
     }
     Size = N;
-    clear_unused_bits();
+    if (t)
+      clear_unused_bits();
   }
 
   void reserve(unsigned N) {