summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic_maps.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-07 10:46:22 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 10:46:23 -0700
commit4997b22f84307521a62838f874928bf56cd3423c (patch)
treead11d99ac0a491ee222e9d0a42ec3b6ad3354e2a /core/fxcrt/fx_basic_maps.cpp
parent0687e76dc259c678b3f29a6608331f07ffd8f1e2 (diff)
downloadpdfium-4997b22f84307521a62838f874928bf56cd3423c.tar.xz
Get rid of NULLs in core/
Review-Url: https://codereview.chromium.org/2032613003
Diffstat (limited to 'core/fxcrt/fx_basic_maps.cpp')
-rw-r--r--core/fxcrt/fx_basic_maps.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/fxcrt/fx_basic_maps.cpp b/core/fxcrt/fx_basic_maps.cpp
index dda8167bdb..2424b82714 100644
--- a/core/fxcrt/fx_basic_maps.cpp
+++ b/core/fxcrt/fx_basic_maps.cpp
@@ -76,11 +76,10 @@ void* CFX_MapPtrToPtr::GetValueAt(void* key) const {
void*& CFX_MapPtrToPtr::operator[](void* key) {
uint32_t nHash;
- CAssoc* pAssoc;
- if ((pAssoc = GetAssocAt(key, nHash)) == NULL) {
- if (!m_pHashTable) {
+ CAssoc* pAssoc = GetAssocAt(key, nHash);
+ if (!pAssoc) {
+ if (!m_pHashTable)
InitHashTable(m_nHashTableSize);
- }
pAssoc = NewAssoc();
pAssoc->key = key;
pAssoc->pNext = m_pHashTable[nHash];
@@ -92,14 +91,14 @@ CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::GetAssocAt(void* key,
uint32_t& nHash) const {
nHash = HashKey(key) % m_nHashTableSize;
if (!m_pHashTable) {
- return NULL;
+ return nullptr;
}
CAssoc* pAssoc;
for (pAssoc = m_pHashTable[nHash]; pAssoc; pAssoc = pAssoc->pNext) {
if (pAssoc->key == key)
return pAssoc;
}
- return NULL;
+ return nullptr;
}
CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::NewAssoc() {
if (!m_pFreeList) {
@@ -125,7 +124,7 @@ void CFX_MapPtrToPtr::InitHashTable(uint32_t nHashSize, FX_BOOL bAllocNow) {
ASSERT(m_nCount == 0);
ASSERT(nHashSize > 0);
FX_Free(m_pHashTable);
- m_pHashTable = NULL;
+ m_pHashTable = nullptr;
if (bAllocNow) {
m_pHashTable = FX_Alloc(CAssoc*, nHashSize);
}