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

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: 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
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 58b03c1887410a6acbd2fa440ec81bc097bb1079..c503277f878f3078fa5f75227c572dc88ced0a37 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -582,7 +582,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;
@@ -736,7 +736,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();
@@ -747,14 +747,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()) {
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698