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

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render_cache.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/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index 7a28ddc782844d1167c636717deb129656157354..babf70396b08e1653811b61da09b509416970117 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp
@@ -74,7 +74,7 @@ void CPDF_PageRenderCache::CacheOptimization(int32_t dwLimitCacheSize) {
}
void CPDF_PageRenderCache::ClearImageCache(CPDF_Stream* pStream) {
void* value = m_ImageCaches.GetValueAt(pStream);
- if (value == NULL) {
+ if (!value) {
m_ImageCaches.RemoveKey(pStream);
return;
}
@@ -95,7 +95,7 @@ FX_DWORD CPDF_PageRenderCache::EstimateSize() {
return dwSize;
}
FX_DWORD CPDF_PageRenderCache::GetCachedSize(CPDF_Stream* pStream) const {
- if (pStream == NULL) {
+ if (!pStream) {
return m_nCacheSize;
}
CPDF_ImageCache* pImageCache;
@@ -175,7 +175,7 @@ void CPDF_PageRenderCache::ResetBitmap(CPDF_Stream* pStream,
const CFX_DIBitmap* pBitmap) {
CPDF_ImageCache* pImageCache;
if (!m_ImageCaches.Lookup(pStream, (void*&)pImageCache)) {
- if (pBitmap == NULL) {
+ if (!pBitmap) {
return;
}
pImageCache = new CPDF_ImageCache(m_pPage->m_pDocument, pStream);
@@ -220,7 +220,7 @@ void CPDF_PageRenderCache::ClearImageData() {
}
}
void CPDF_ImageCache::ClearImageData() {
- if (m_pCachedBitmap && m_pCachedBitmap->GetBuffer() == NULL) {
+ if (m_pCachedBitmap && !m_pCachedBitmap->GetBuffer()) {
((CPDF_DIBSource*)m_pCachedBitmap)->ClearImageData();
}
}
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698