diff options
author | Lei Zhang <thestig@chromium.org> | 2016-02-24 15:26:50 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2016-02-24 15:26:50 -0800 |
commit | 38eaaf36b09b816b963015e33dc4eb02580e0462 (patch) | |
tree | 9a2721eb404a2de4ddce91b50cac25b2cac0edb1 /xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp | |
parent | e1fb98394a6885cf03bdc6391e5a3878aad5b375 (diff) | |
download | pdfium-38eaaf36b09b816b963015e33dc4eb02580e0462.tar.xz |
Remove foo != NULL checks in xfa/src/fxbarcode.
R=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1726373002 .
Diffstat (limited to 'xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp')
-rw-r--r-- | xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp index d4d0cb6148..d44995385a 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRBitMatrixParser.cpp @@ -41,15 +41,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; @@ -65,7 +61,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); @@ -80,7 +76,7 @@ CBC_QRCoderFormatInformation* CBC_QRBitMatrixParser::ReadFormatInformation( } m_parsedFormatInfo = CBC_QRCoderFormatInformation::DecodeFormatInformation(formatInfoBits); - if (m_parsedFormatInfo != NULL) { + if (m_parsedFormatInfo) { return m_parsedFormatInfo; } e = BCExceptionRead; @@ -88,7 +84,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); @@ -109,7 +105,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; @@ -121,7 +117,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; |