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

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: 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/qrcode/BC_QRBitMatrixParser.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
index 4bd502665f391184786ad8aa40ee7038517fafe9..c8f5da96905be2e079fac5a23e65e2373e6f45ec 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp
@@ -40,15 +40,11 @@ void CBC_QRBitMatrixParser::Init(CBC_CommonBitMatrix* bitMatrix, int32_t& e) {
m_version = NULL;
}
CBC_QRBitMatrixParser::~CBC_QRBitMatrixParser() {
- if (m_parsedFormatInfo != NULL) {
- delete m_parsedFormatInfo;
- m_parsedFormatInfo = NULL;
- }
- m_version = NULL;
+ delete m_parsedFormatInfo;
}
CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(
int32_t& e) {
- if (m_parsedFormatInfo != NULL) {
+ if (m_parsedFormatInfo) {
return m_parsedFormatInfo;
}
int32_t formatInfoBits = 0;
@@ -64,7 +60,7 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(
}
m_parsedFormatInfo =
CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits);
- if (m_parsedFormatInfo != NULL) {
+ if (m_parsedFormatInfo) {
return m_parsedFormatInfo;
}
int32_t dimension = m_bitMatrix->GetDimension(e);
@@ -79,7 +75,7 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(
}
m_parsedFormatInfo =
CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits);
- if (m_parsedFormatInfo != NULL) {
+ if (m_parsedFormatInfo) {
return m_parsedFormatInfo;
}
e = BCExceptionRead;
@@ -87,7 +83,7 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation(
return NULL;
}
CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(int32_t& e) {
- if (m_version != NULL) {
+ if (m_version) {
return m_version;
}
int32_t dimension = m_bitMatrix->GetDimension(e);
@@ -108,7 +104,7 @@ CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(int32_t& e) {
}
m_version = CBC_QRCoderVersion::DecodeVersionInformation(versionBits, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- if (m_version != NULL && m_version->GetDimensionForVersion() == dimension) {
+ if (m_version && m_version->GetDimensionForVersion() == dimension) {
return m_version;
}
versionBits = 0;
@@ -120,7 +116,7 @@ CBC_QRCoderVersion* CBC_QRBitMatrixParser::ReadVersion(int32_t& e) {
}
m_version = CBC_QRCoderVersion::DecodeVersionInformation(versionBits, e);
BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
- if (m_version != NULL && m_version->GetDimensionForVersion() == dimension) {
+ if (m_version && m_version->GetDimensionForVersion() == dimension) {
return m_version;
}
e = BCExceptionRead;

Powered by Google App Engine
This is Rietveld 408576698