[llvm-commits] CVS: llvm/include/llvm/ADT/BitVector.h
Evan Cheng
evan.cheng at apple.com
Thu Feb 15 11:18:28 PST 2007
Changes in directory llvm/include/llvm/ADT:
BitVector.h updated: 1.10 -> 1.11
---
Log message:
Remove unnecessary checks.
---
Diffs of the changes: (+5 -10)
BitVector.h | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
Index: llvm/include/llvm/ADT/BitVector.h
diff -u llvm/include/llvm/ADT/BitVector.h:1.10 llvm/include/llvm/ADT/BitVector.h:1.11
--- llvm/include/llvm/ADT/BitVector.h:1.10 Thu Feb 15 13:16:21 2007
+++ llvm/include/llvm/ADT/BitVector.h Thu Feb 15 13:18:12 2007
@@ -179,10 +179,8 @@
// 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 @@
}
BitVector &reset() {
- if (Bits)
- init_words(Bits, Capacity, false);
+ init_words(Bits, Capacity, false);
return *this;
}
@@ -317,14 +314,12 @@
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));
}
};
More information about the llvm-commits
mailing list