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

Unified Diff: xfa/fgas/crt/fgas_utils.h

Issue 2031873003: Get rid of NULLs in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_fpdfsdk
Patch Set: 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 | « xfa/fgas/crt/fgas_system.cpp ('k') | xfa/fgas/crt/fgas_utils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/crt/fgas_utils.h
diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h
index 6fef23d96849e515bc4668401b8b747c0bf41c1d..88b53e52db66c77d07e37b5d43dcd391f8708cbf 100644
--- a/xfa/fgas/crt/fgas_utils.h
+++ b/xfa/fgas/crt/fgas_utils.h
@@ -374,7 +374,7 @@ class CFX_DiscreteArrayTemplate : public CFX_BaseDiscreteArray {
: CFX_BaseDiscreteArray(iChunkSize, sizeof(baseType)) {}
baseType& GetAt(int32_t index, const baseType& defValue) const {
baseType* p = (baseType*)CFX_BaseDiscreteArray::GetAt(index);
- return p == NULL ? (baseType&)defValue : *p;
+ return p ? *p : (baseType&)defValue;
}
baseType* GetPtrAt(int32_t index) const {
return (baseType*)CFX_BaseDiscreteArray::GetAt(index);
@@ -442,7 +442,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack {
}
void Pop() {
baseType* p = (baseType*)CFX_BaseStack::GetTopElement();
- if (p != NULL) {
+ if (p) {
p->~baseType();
}
CFX_BaseStack::Pop();
« no previous file with comments | « xfa/fgas/crt/fgas_system.cpp ('k') | xfa/fgas/crt/fgas_utils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698