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

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp

Issue 1520063002: Get rid of most instance of 'foo == NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium@bstr_isnull
Patch Set: self review 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
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 7858eae057d53cce61bd342eb4477fa1e556e4e9..c75361b5fa6d08ac47523cf03cf3ff5d9696d3b0 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -583,7 +583,7 @@ FX_POSITION CPDF_Dictionary::GetStartPos() const {
}
CPDF_Object* CPDF_Dictionary::GetNextElement(FX_POSITION& pos,
CFX_ByteString& key) const {
- if (pos == NULL) {
+ if (!pos) {
return NULL;
}
CPDF_Object* p;
@@ -737,7 +737,7 @@ void CPDF_Dictionary::RemoveAt(const CFX_ByteStringC& key) {
ASSERT(m_Type == PDFOBJ_DICTIONARY);
CPDF_Object* p = NULL;
m_Map.Lookup(key, (void*&)p);
- if (p == NULL) {
+ if (!p) {
return;
}
p->Release();
@@ -748,14 +748,14 @@ void CPDF_Dictionary::ReplaceKey(const CFX_ByteStringC& oldkey,
ASSERT(m_Type == PDFOBJ_DICTIONARY);
CPDF_Object* p = NULL;
m_Map.Lookup(oldkey, (void*&)p);
- if (p == NULL) {
+ if (!p) {
return;
}
m_Map.RemoveKey(oldkey);
m_Map.SetAt(newkey, p);
}
FX_BOOL CPDF_Dictionary::Identical(CPDF_Dictionary* pOther) const {
- if (pOther == NULL) {
+ if (!pOther) {
return FALSE;
}
if (m_Map.GetCount() != pOther->m_Map.GetCount()) {
@@ -1156,7 +1156,7 @@ void CPDF_IndirectObjects::ReleaseIndirectObject(FX_DWORD objnum) {
}
void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum,
CPDF_Object* pObj) {
- if (objnum == 0 || pObj == NULL) {
+ if (objnum == 0 || !pObj) {
return;
}
void* value = NULL;

Powered by Google App Engine
This is Rietveld 408576698