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

Unified Diff: core/src/fxcrt/fx_xml_parser.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_extension.cpp ('k') | core/src/fxge/agg/src/fx_agg_driver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcrt/fx_xml_parser.cpp
diff --git a/core/src/fxcrt/fx_xml_parser.cpp b/core/src/fxcrt/fx_xml_parser.cpp
index 56fbada3addddba93f4c7c3bab205b49acf4601c..0b71836ef9cfd057184f08d192d5521e0c0e8a64 100644
--- a/core/src/fxcrt/fx_xml_parser.cpp
+++ b/core/src/fxcrt/fx_xml_parser.cpp
@@ -463,7 +463,7 @@ CXML_Element* CXML_Parser::ParseElement(CXML_Element* pParent,
iState = 0;
m_dwIndex--;
CXML_Element* pSubElement = ParseElement(pElement, TRUE);
- if (pSubElement == NULL) {
+ if (!pSubElement) {
break;
}
pSubElement->m_pParent = pElement;
@@ -767,7 +767,7 @@ FX_DWORD CXML_Element::FindElement(CXML_Element* pChild) const {
}
const CFX_WideString* CXML_AttrMap::Lookup(const CFX_ByteStringC& space,
const CFX_ByteStringC& name) const {
- if (m_pMap == NULL) {
+ if (!m_pMap) {
return NULL;
}
for (int i = 0; i < m_pMap->GetSize(); i++) {
@@ -803,7 +803,7 @@ void CXML_AttrMap::SetAt(const CFX_ByteStringC& space,
}
void CXML_AttrMap::RemoveAt(const CFX_ByteStringC& space,
const CFX_ByteStringC& name) {
- if (m_pMap == NULL) {
+ if (!m_pMap) {
return;
}
for (int i = 0; i < m_pMap->GetSize(); i++) {
@@ -816,7 +816,7 @@ void CXML_AttrMap::RemoveAt(const CFX_ByteStringC& space,
}
}
int CXML_AttrMap::GetSize() const {
- return m_pMap == NULL ? 0 : m_pMap->GetSize();
+ return m_pMap ? m_pMap->GetSize() : 0;
}
CXML_AttrItem& CXML_AttrMap::GetAt(int index) const {
return (*m_pMap)[index];
« no previous file with comments | « core/src/fxcrt/fx_extension.cpp ('k') | core/src/fxge/agg/src/fx_agg_driver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698