Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: core/src/fxcrt/fx_basic_maps.cpp

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxcrt/fx_basic_list.cpp ('k') | core/src/fxcrt/fx_basic_util.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_basic_maps.cpp
diff --git a/core/src/fxcrt/fx_basic_maps.cpp b/core/src/fxcrt/fx_basic_maps.cpp
index f8751ae3400263b596c0bb9c9055677bc3e778f7..f8a03901630c8cfd66dba254cca279987bbb7982 100644
--- a/core/src/fxcrt/fx_basic_maps.cpp
+++ b/core/src/fxcrt/fx_basic_maps.cpp
@@ -60,7 +60,7 @@ void CFX_MapPtrToPtr::GetNextAssoc(FX_POSITION& rNextPosition,
FX_BOOL CFX_MapPtrToPtr::Lookup(void* key, void*& rValue) const {
FX_DWORD nHash;
CAssoc* pAssoc = GetAssocAt(key, nHash);
- if (pAssoc == NULL) {
+ if (!pAssoc) {
return FALSE;
}
rValue = pAssoc->value;
@@ -69,7 +69,7 @@ FX_BOOL CFX_MapPtrToPtr::Lookup(void* key, void*& rValue) const {
void* CFX_MapPtrToPtr::GetValueAt(void* key) const {
FX_DWORD nHash;
CAssoc* pAssoc = GetAssocAt(key, nHash);
- if (pAssoc == NULL) {
+ if (!pAssoc) {
return NULL;
}
return pAssoc->value;
@@ -78,7 +78,7 @@ void*& CFX_MapPtrToPtr::operator[](void* key) {
FX_DWORD nHash;
CAssoc* pAssoc;
if ((pAssoc = GetAssocAt(key, nHash)) == NULL) {
- if (m_pHashTable == NULL) {
+ if (!m_pHashTable) {
InitHashTable(m_nHashTableSize);
}
pAssoc = NewAssoc();
@@ -91,7 +91,7 @@ void*& CFX_MapPtrToPtr::operator[](void* key) {
CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::GetAssocAt(void* key,
FX_DWORD& nHash) const {
nHash = HashKey(key) % m_nHashTableSize;
- if (m_pHashTable == NULL) {
+ if (!m_pHashTable) {
return NULL;
}
CAssoc* pAssoc;
@@ -102,7 +102,7 @@ CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::GetAssocAt(void* key,
return NULL;
}
CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::NewAssoc() {
- if (m_pFreeList == NULL) {
+ if (!m_pFreeList) {
CFX_Plex* newBlock = CFX_Plex::Create(m_pBlocks, m_nBlockSize,
sizeof(CFX_MapPtrToPtr::CAssoc));
CFX_MapPtrToPtr::CAssoc* pAssoc =
@@ -132,7 +132,7 @@ void CFX_MapPtrToPtr::InitHashTable(FX_DWORD nHashSize, FX_BOOL bAllocNow) {
m_nHashTableSize = nHashSize;
}
FX_BOOL CFX_MapPtrToPtr::RemoveKey(void* key) {
- if (m_pHashTable == NULL) {
+ if (!m_pHashTable) {
return FALSE;
}
CAssoc** ppAssocPrev;
@@ -237,7 +237,7 @@ FX_POSITION CFX_CMapByteStringToPtr::GetStartPosition() const {
void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition,
CFX_ByteString& rKey,
void*& rValue) const {
- if (rNextPosition == NULL) {
+ if (!rNextPosition) {
return;
}
int index = (int)(uintptr_t)rNextPosition - 1;
@@ -257,7 +257,7 @@ void CFX_CMapByteStringToPtr::GetNextAssoc(FX_POSITION& rNextPosition,
rNextPosition = NULL;
}
void* CFX_CMapByteStringToPtr::GetNextValue(FX_POSITION& rNextPosition) const {
- if (rNextPosition == NULL) {
+ if (!rNextPosition) {
return NULL;
}
int index = (int)(uintptr_t)rNextPosition - 1;
« no previous file with comments | « core/src/fxcrt/fx_basic_list.cpp ('k') | core/src/fxcrt/fx_basic_util.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698