diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-02-15 19:12:39 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-02-15 19:12:39 +0000 |
commit | c761df18ae4979a8f2a0d3c5c35cda41db2a3f0b (patch) | |
tree | c66a6eca91835eebfb6418d9fe23e704834e1305 | |
parent | ccae61c5da270b0684c4c7d2450d9bf3ff35aac7 (diff) |
Merges two resize() variants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34316 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/BitVector.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index 6910be04e5..bbbb179ee4 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) { |