summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.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_QRCoderBitVector.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_QRCoderBitVector.cpp')
-rw-r--r--xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp15
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;
}