summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/StringMap.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-04-09 04:20:00 +0000
committerCraig Topper <craig.topper@gmail.com>2014-04-09 04:20:00 +0000
commit8d399f87af9e98b1103ba794bcda4b33ff534f65 (patch)
tree61a5a0e459a82e1ecc9fc852c3a920269bd6a59f /llvm/lib/Support/StringMap.cpp
parentc65a56901f6235739b6362a4f787ef609daa5ddd (diff)
downloadbcm5719-llvm-8d399f87af9e98b1103ba794bcda4b33ff534f65.tar.gz
bcm5719-llvm-8d399f87af9e98b1103ba794bcda4b33ff534f65.zip
[C++11] Replace some comparisons with 'nullptr' with simple boolean checks to reduce verbosity.
llvm-svn: 205829
Diffstat (limited to 'llvm/lib/Support/StringMap.cpp')
-rw-r--r--llvm/lib/Support/StringMap.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/StringMap.cpp b/llvm/lib/Support/StringMap.cpp
index 30b6abb3b42..72a6d822d2b 100644
--- a/llvm/lib/Support/StringMap.cpp
+++ b/llvm/lib/Support/StringMap.cpp
@@ -70,7 +70,7 @@ unsigned StringMapImpl::LookupBucketFor(StringRef Name) {
while (1) {
StringMapEntryBase *BucketItem = TheTable[BucketNo];
// If we found an empty bucket, this key isn't in the table yet, return it.
- if (LLVM_LIKELY(BucketItem == nullptr)) {
+ if (LLVM_LIKELY(!BucketItem)) {
// If we found a tombstone, we want to reuse the tombstone instead of an
// empty bucket. This reduces probing.
if (FirstTombstone != -1) {
@@ -124,7 +124,7 @@ int StringMapImpl::FindKey(StringRef Key) const {
while (1) {
StringMapEntryBase *BucketItem = TheTable[BucketNo];
// If we found an empty bucket, this key isn't in the table yet, return.
- if (LLVM_LIKELY(BucketItem == nullptr))
+ if (LLVM_LIKELY(!BucketItem))
return -1;
if (BucketItem == getTombstoneVal()) {
@@ -212,7 +212,7 @@ void StringMapImpl::RehashTable() {
// Fast case, bucket available.
unsigned FullHash = HashTable[I];
unsigned NewBucket = FullHash & (NewSize-1);
- if (NewTableArray[NewBucket] == nullptr) {
+ if (!NewTableArray[NewBucket]) {
NewTableArray[FullHash & (NewSize-1)] = Bucket;
NewHashArray[FullHash & (NewSize-1)] = FullHash;
continue;
OpenPOWER on IntegriCloud