From 84142d660748947030ad68b020dd761d2453f0ed Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 15 Feb 2007 19:12:39 +0000 Subject: [PATCH] Merges two resize() variants. llvm-svn: 34316 --- include/llvm/ADT/BitVector.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index 6910be04e51..bbbb179ee4d 100644 --- a/include/llvm/ADT/BitVector.h +++ b/include/llvm/ADT/BitVector.h @@ -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) {