summaryrefslogtreecommitdiff
path: root/core/src/fxcrt/fx_basic_maps.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-14 22:22:13 -0700
committerLei Zhang <thestig@chromium.org>2015-08-14 22:22:13 -0700
commitda180e9fdd4385df024cc18046f62ca47bc74d74 (patch)
tree931e0e64ac2cbc82e3718e43418ee6bd676da4a5 /core/src/fxcrt/fx_basic_maps.cpp
parent2b1a2d528469cda4e9f3e36d3c7a649e0d476480 (diff)
downloadpdfium-da180e9fdd4385df024cc18046f62ca47bc74d74.tar.xz
Merge to XFA: Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 . (cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b) Review URL: https://codereview.chromium.org/1287053005 .
Diffstat (limited to 'core/src/fxcrt/fx_basic_maps.cpp')
-rw-r--r--core/src/fxcrt/fx_basic_maps.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/core/src/fxcrt/fx_basic_maps.cpp b/core/src/fxcrt/fx_basic_maps.cpp
index 14a681b832..1558ae6f75 100644
--- a/core/src/fxcrt/fx_basic_maps.cpp
+++ b/core/src/fxcrt/fx_basic_maps.cpp
@@ -23,10 +23,8 @@ CFX_MapPtrToPtr::CFX_MapPtrToPtr(int nBlockSize)
ASSERT(m_nBlockSize > 0);
}
void CFX_MapPtrToPtr::RemoveAll() {
- if (m_pHashTable) {
- FX_Free(m_pHashTable);
- m_pHashTable = NULL;
- }
+ FX_Free(m_pHashTable);
+ m_pHashTable = NULL;
m_nCount = 0;
m_pFreeList = NULL;
m_pBlocks->FreeDataChain();
@@ -134,10 +132,8 @@ CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::NewAssoc() {
void CFX_MapPtrToPtr::InitHashTable(FX_DWORD nHashSize, FX_BOOL bAllocNow) {
ASSERT(m_nCount == 0);
ASSERT(nHashSize > 0);
- if (m_pHashTable != NULL) {
- FX_Free(m_pHashTable);
- m_pHashTable = NULL;
- }
+ FX_Free(m_pHashTable);
+ m_pHashTable = NULL;
if (bAllocNow) {
m_pHashTable = FX_Alloc(CAssoc*, nHashSize);
}
@@ -321,10 +317,8 @@ void CFX_MapByteStringToPtr::InitHashTable(FX_DWORD nHashSize,
FX_BOOL bAllocNow) {
ASSERT(m_nCount == 0);
ASSERT(nHashSize > 0);
- if (m_pHashTable != NULL) {
- FX_Free(m_pHashTable);
- m_pHashTable = NULL;
- }
+ FX_Free(m_pHashTable);
+ m_pHashTable = NULL;
if (bAllocNow) {
m_pHashTable = FX_Alloc(CAssoc*, nHashSize);
}