From 981a3468319eb24e696bb64ba84d9631fd26f1f7 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 19 May 2015 15:19:32 -0700 Subject: Re-land: Remove FX_Alloc() null checks now that it can't return NULL. Fixes the ordering of some assignments broken when converting to checked numerics in CFX_PathData::AddPointCount(). Original Review URL: https://codereview.chromium.org/1142713005 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1135893008 --- core/src/fxcrt/fx_basic_buffer.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'core/src/fxcrt/fx_basic_buffer.cpp') diff --git a/core/src/fxcrt/fx_basic_buffer.cpp b/core/src/fxcrt/fx_basic_buffer.cpp index 7903740e47..06ba9413a5 100644 --- a/core/src/fxcrt/fx_basic_buffer.cpp +++ b/core/src/fxcrt/fx_basic_buffer.cpp @@ -88,10 +88,8 @@ void CFX_BinaryBuf::ExpandBuf(FX_STRSIZE add_size) } else { pNewBuffer = FX_Alloc(FX_BYTE, new_size); } - if (pNewBuffer) { - m_pBuffer = pNewBuffer; - m_AllocSize = new_size; - } + m_pBuffer = pNewBuffer; + m_AllocSize = new_size; } void CFX_BinaryBuf::CopyData(const void* pStr, FX_STRSIZE size) { @@ -456,9 +454,6 @@ FX_INT32 IFX_BufferArchive::AppendBlock(const void* pBuf, size_t size) } if (!m_pBuffer) { m_pBuffer = FX_Alloc(FX_BYTE, m_BufSize); - if (!m_pBuffer) { - return -1; - } } FX_LPBYTE buffer = (FX_LPBYTE)pBuf; FX_STRSIZE temp_size = (FX_STRSIZE)size; -- cgit v1.2.3