summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp
diff options
context:
space:
mode:
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;
}