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

Unified Diff: xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 10 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
Index: xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp
diff --git a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp
index 273f4906d1819910de4b5274968058965e03c0ee..54556af97c9e3635fce66d9aff0671997cfe2a82 100644
--- a/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp
+++ b/xfa/src/fxbarcode/pdf417/BC_PDF417Detector.cpp
@@ -124,10 +124,10 @@ CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple,
for (int32_t i = 0; i < barcodeCoordinates->GetSize(); i++) {
CFX_PtrArray* barcodeCoordinate =
(CFX_PtrArray*)barcodeCoordinates->GetAt(i);
- if (barcodeCoordinate->GetAt(1) != NULL) {
+ if (barcodeCoordinate->GetAt(1)) {
row = row > ((CBC_ResultPoint*)barcodeCoordinate->GetAt(1))->GetY();
}
- if (barcodeCoordinate->GetAt(3) != NULL) {
+ if (barcodeCoordinate->GetAt(3)) {
row = row > ((CBC_ResultPoint*)barcodeCoordinate->GetAt(3))->GetY();
}
}
@@ -142,7 +142,7 @@ CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple,
if (!multiple) {
break;
}
- if (vertices->GetAt(2) != NULL) {
+ if (vertices->GetAt(2)) {
column = (int32_t)((CBC_ResultPoint*)vertices->GetAt(2))->GetX();
row = (int32_t)((CBC_ResultPoint*)vertices->GetAt(2))->GetY();
} else {
@@ -167,7 +167,7 @@ CFX_PtrArray* CBC_Detector::findVertices(CBC_CommonBitMatrix* matrix,
sizeof(INDEXES_START_PATTERN) / sizeof(INDEXES_START_PATTERN[0]));
startptr->RemoveAll();
delete startptr;
- if (result->GetAt(4) != NULL) {
+ if (result->GetAt(4)) {
startColumn = (int32_t)((CBC_ResultPoint*)result->GetAt(4))->GetX();
startRow = (int32_t)((CBC_ResultPoint*)result->GetAt(4))->GetY();
}
@@ -204,12 +204,12 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix,
CFX_Int32Array* loc =
findGuardPattern(matrix, startColumn, startRow, width, FALSE, pattern,
patternLength, counters);
- if (loc != NULL) {
+ if (loc) {
while (startRow > 0) {
CFX_Int32Array* previousRowLoc =
findGuardPattern(matrix, startColumn, --startRow, width, FALSE,
pattern, patternLength, counters);
- if (previousRowLoc != NULL) {
+ if (previousRowLoc) {
delete loc;
loc = previousRowLoc;
} else {
@@ -236,8 +236,7 @@ CFX_PtrArray* CBC_Detector::findRowsWithPattern(CBC_CommonBitMatrix* matrix,
CFX_Int32Array* loc =
findGuardPattern(matrix, previousRowLoc[0], stopRow, width, FALSE,
pattern, patternLength, counters);
- if (loc != NULL &&
- abs(previousRowLoc[0] - loc->GetAt(0)) < MAX_PATTERN_DRIFT &&
+ if (loc && abs(previousRowLoc[0] - loc->GetAt(0)) < MAX_PATTERN_DRIFT &&
abs(previousRowLoc[1] - loc->GetAt(1)) < MAX_PATTERN_DRIFT) {
previousRowLoc.Copy(*loc);
skippedRowCount = 0;

Powered by Google App Engine
This is Rietveld 408576698