mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Merges two resize() variants.
llvm-svn: 34316
This commit is contained in:
parent
fe4d7486d2
commit
84142d6607
@ -161,22 +161,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// resize - Grow or shrink the bitvector.
|
/// resize - Grow or shrink the bitvector.
|
||||||
void resize(unsigned N) {
|
void resize(unsigned N, bool t = false) {
|
||||||
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) {
|
|
||||||
if (N > Capacity * BITS_PER_WORD) {
|
if (N > Capacity * BITS_PER_WORD) {
|
||||||
unsigned OldCapacity = Capacity;
|
unsigned OldCapacity = Capacity;
|
||||||
grow(N);
|
grow(N);
|
||||||
init_words(&Bits[OldCapacity], (Capacity-OldCapacity), t);
|
init_words(&Bits[OldCapacity], (Capacity-OldCapacity), t);
|
||||||
}
|
}
|
||||||
Size = N;
|
Size = N;
|
||||||
|
if (t)
|
||||||
clear_unused_bits();
|
clear_unused_bits();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user