summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/BitVector.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-02-15 19:18:12 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-02-15 19:18:12 +0000
commit1f46998b3f05bea569db27b3de78a091aa943ca3 (patch)
tree9d4196bc5f013549611e5be29846808673b1bac6 /include/llvm/ADT/BitVector.h
parent3b515802f652b16b05c9a8f344d219a0739b36a3 (diff)
downloadllvm-1f46998b3f05bea569db27b3de78a091aa943ca3.tar.gz
llvm-1f46998b3f05bea569db27b3de78a091aa943ca3.tar.bz2
llvm-1f46998b3f05bea569db27b3de78a091aa943ca3.tar.xz
Remove unnecessary checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34319 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/BitVector.h')
-rw-r--r--include/llvm/ADT/BitVector.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h
index 0677b5449d..d728473117 100644
--- a/include/llvm/ADT/BitVector.h
+++ b/include/llvm/ADT/BitVector.h
@@ -179,10 +179,8 @@ public:
// 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 @@ public:
}
BitVector &reset() {
- if (Bits)
- init_words(Bits, Capacity, false);
+ init_words(Bits, Capacity, false);
return *this;
}
@@ -317,14 +314,12 @@ private:
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));
}
};