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_QRCoderBitVector.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_QRCoderBitVector.cpp')
-rw-r--r-- | xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp index 28f30cab09..ad1b3200ab 100644 --- a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp +++ b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp @@ -32,17 +32,10 @@ void CBC_QRCoderBitVector::Init() { m_array = FX_Alloc(uint8_t, m_size); } CBC_QRCoderBitVector::~CBC_QRCoderBitVector() { - if (m_array != NULL) { - FX_Free(m_array); - } - m_size = 0; - m_sizeInBits = 0; + FX_Free(m_array); } void CBC_QRCoderBitVector::Clear() { - if (m_array != NULL) { - FX_Free(m_array); - m_array = NULL; - } + FX_Free(m_array); m_sizeInBits = 0; m_size = 32; m_array = FX_Alloc(uint8_t, m_size); @@ -122,9 +115,7 @@ void CBC_QRCoderBitVector::AppendByte(int32_t value) { if ((m_sizeInBits >> 3) == m_size) { uint8_t* newArray = FX_Alloc(uint8_t, m_size << 1); FXSYS_memcpy(newArray, m_array, m_size); - if (m_array != NULL) { - FX_Free(m_array); - } + FX_Free(m_array); m_array = newArray; m_size = m_size << 1; } |