diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
commit | 412e908082a361d0fd9591eab939e96a882212f1 (patch) | |
tree | 11726052ae08f13dc5a05a82cbce870758580aeb /core/src/fxcrt/fx_basic_list.cpp | |
parent | 96660d6f382204339d6b1aadc3913303d436e252 (diff) | |
download | pdfium-412e908082a361d0fd9591eab939e96a882212f1.tar.xz |
Merge to XFA: Get rid of most instance of 'foo == NULL'
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1520063002 .
(cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff)
Review URL: https://codereview.chromium.org/1528763003 .
Diffstat (limited to 'core/src/fxcrt/fx_basic_list.cpp')
-rw-r--r-- | core/src/fxcrt/fx_basic_list.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/src/fxcrt/fx_basic_list.cpp b/core/src/fxcrt/fx_basic_list.cpp index 292e2a7b53..81173d6a0b 100644 --- a/core/src/fxcrt/fx_basic_list.cpp +++ b/core/src/fxcrt/fx_basic_list.cpp @@ -37,7 +37,7 @@ FX_POSITION CFX_PtrList::AddHead(void* newElement) { return (FX_POSITION)pNewNode; } FX_POSITION CFX_PtrList::InsertAfter(FX_POSITION position, void* newElement) { - if (position == NULL) { + if (!position) { return AddTail(newElement); } CNode* pOldNode = (CNode*)position; @@ -81,7 +81,7 @@ void CFX_PtrList::RemoveAll() { } CFX_PtrList::CNode* CFX_PtrList::NewNode(CFX_PtrList::CNode* pPrev, CFX_PtrList::CNode* pNext) { - if (m_pNodeFree == NULL) { + if (!m_pNodeFree) { CFX_Plex* pNewBlock = CFX_Plex::Create(m_pBlocks, m_nBlockSize, sizeof(CNode)); CNode* pNode = (CNode*)pNewBlock->data(); @@ -116,11 +116,7 @@ FX_POSITION CFX_PtrList::FindIndex(int nIndex) const { } FX_POSITION CFX_PtrList::Find(void* searchValue, FX_POSITION startAfter) const { CNode* pNode = (CNode*)startAfter; - if (pNode == NULL) { - pNode = m_pNodeHead; - } else { - pNode = pNode->pNext; - } + pNode = pNode ? pNode->pNext : m_pNodeHead; for (; pNode; pNode = pNode->pNext) { if (pNode->data == searchValue) return (FX_POSITION)pNode; |