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

Unified Diff: core/src/fpdftext/fpdf_text_int.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/fpdftext/fpdf_text.cpp ('k') | core/src/fpdftext/fpdf_text_search.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdftext/fpdf_text_int.cpp
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index 8a359fe9af0f71b6b3d6f9af9cd43fe2ffbbc156..1e6d54d13398eff87710b2747300d9ad45f0b3f5 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -2464,12 +2464,12 @@ FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString,
const FX_WCHAR* lpszFullString,
int iSubString,
FX_WCHAR chSep) {
- if (lpszFullString == NULL) {
+ if (!lpszFullString) {
return FALSE;
}
while (iSubString--) {
lpszFullString = FXSYS_wcschr(lpszFullString, chSep);
- if (lpszFullString == NULL) {
+ if (!lpszFullString) {
rString.Empty();
return FALSE;
}
@@ -2479,8 +2479,8 @@ FX_BOOL CPDF_TextPageFind::ExtractSubString(CFX_WideString& rString,
}
}
const FX_WCHAR* lpchEnd = FXSYS_wcschr(lpszFullString, chSep);
- int nLen = (lpchEnd == NULL) ? (int)FXSYS_wcslen(lpszFullString)
- : (int)(lpchEnd - lpszFullString);
+ int nLen = lpchEnd ? (int)(lpchEnd - lpszFullString)
+ : (int)FXSYS_wcslen(lpszFullString);
ASSERT(nLen >= 0);
FXSYS_memcpy(rString.GetBuffer(nLen), lpszFullString,
nLen * sizeof(FX_WCHAR));
« no previous file with comments | « core/src/fpdftext/fpdf_text.cpp ('k') | core/src/fpdftext/fpdf_text_search.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698