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

Unified Diff: core/fxcrt/fx_basic_maps.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Fix a bad merge Created 4 years, 6 months 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/fxcrt/fx_basic_list.cpp ('k') | core/fxcrt/fx_extension.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_maps.cpp
diff --git a/core/fxcrt/fx_basic_maps.cpp b/core/fxcrt/fx_basic_maps.cpp
index dda8167bdba572721f0ef4ddd28e9cc168fef61c..2424b82714249cf8988c98937637b8f68f1416d0 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);
}
« no previous file with comments | « core/fxcrt/fx_basic_list.cpp ('k') | core/fxcrt/fx_extension.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698