Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Unified Diff: xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp

Issue 1726373002: Remove foo != NULL checks in xfa/src/fxbarcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp ('k') | xfa/src/fxbarcode/qrcode/BC_QRCoderBlockPair.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp
diff --git a/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp b/xfa/src/fxbarcode/qrcode/BC_QRCoderBitVector.cpp
index 28f30cab09e3fa2f9d66d346516c4264fa8fd75c..ad1b3200abaeb7924427b90a7f0cab3a3d557b4e 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;
}
« no previous file with comments | « xfa/src/fxbarcode/qrcode/BC_QRCoder.cpp ('k') | xfa/src/fxbarcode/qrcode/BC_QRCoderBlockPair.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698