summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-24 15:26:50 -0800
committerLei Zhang <thestig@chromium.org>2016-02-24 15:26:50 -0800
commit38eaaf36b09b816b963015e33dc4eb02580e0462 (patch)
tree9a2721eb404a2de4ddce91b50cac25b2cac0edb1 /xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
parente1fb98394a6885cf03bdc6391e5a3878aad5b375 (diff)
downloadpdfium-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_QRCoder.cpp')
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
index ab370f8842..be46f2dec5 100644
--- a/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
+++ b/xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp
@@ -39,19 +39,7 @@ CBC_QRCoder::CBC_QRCoder() {
m_matrix = NULL;
}
CBC_QRCoder::~CBC_QRCoder() {
- if (m_matrix != NULL) {
- delete m_matrix;
- m_matrix = NULL;
- }
- m_mode = NULL;
- m_ecLevel = NULL;
- m_version = -1;
- m_matrixWidth = -1;
- m_maskPattern = -1;
- m_numTotalBytes = -1;
- m_numDataBytes = -1;
- m_numECBytes = -1;
- m_numRSBlocks = -1;
+ delete m_matrix;
}
CBC_QRCoderMode* CBC_QRCoder::GetMode() {
return m_mode;
@@ -92,11 +80,11 @@ int32_t CBC_QRCoder::At(int32_t x, int32_t y, int32_t& e) {
return value;
}
FX_BOOL CBC_QRCoder::IsValid() {
- return m_mode != NULL && m_ecLevel != NULL && m_version != -1 &&
- m_matrixWidth != -1 && m_maskPattern != -1 && m_numTotalBytes != -1 &&
- m_numDataBytes != -1 && m_numECBytes != -1 && m_numRSBlocks != -1 &&
+ return m_mode && m_ecLevel && m_version != -1 && m_matrixWidth != -1 &&
+ m_maskPattern != -1 && m_numTotalBytes != -1 && m_numDataBytes != -1 &&
+ m_numECBytes != -1 && m_numRSBlocks != -1 &&
IsValidMaskPattern(m_maskPattern) &&
- m_numTotalBytes == m_numDataBytes + m_numECBytes && m_matrix != NULL &&
+ m_numTotalBytes == m_numDataBytes + m_numECBytes && m_matrix &&
m_matrixWidth == m_matrix->GetWidth() &&
m_matrix->GetWidth() == m_matrix->GetHeight();
}