diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-05-10 13:54:54 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-10 19:40:30 +0000 |
commit | aa7022833db1a6e21b81fcca30b45ba652298f32 (patch) | |
tree | 2a24f3f64c57776b27155f742f77c8805aa5215f /core/fxcrt/fx_basic_buffer.cpp | |
parent | 2e2ee0e7f786dbc27a5b85b27d5e91e821069aea (diff) | |
download | pdfium-aa7022833db1a6e21b81fcca30b45ba652298f32.tar.xz |
Cleaning up Edit code
This Cl conslidates if statements, converts int returns to bools where
possible and various other cleanups in fpdfapi/edit.
Change-Id: Ia31ecc69843117eb5ebfff449a6046a267d08e89
Reviewed-on: https://pdfium-review.googlesource.com/5190
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_basic_buffer.cpp')
-rw-r--r-- | core/fxcrt/fx_basic_buffer.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp index 701676f71e..13057f1670 100644 --- a/core/fxcrt/fx_basic_buffer.cpp +++ b/core/fxcrt/fx_basic_buffer.cpp @@ -255,11 +255,9 @@ int32_t CFX_FileBufferArchive::AppendBlock(const void* pBuf, size_t size) { size_t buf_size = std::min(kBufSize - m_Length, temp_size); memcpy(m_pBuffer.get() + m_Length, buffer, buf_size); m_Length += buf_size; - if (m_Length == kBufSize) { - if (!Flush()) { - return -1; - } - } + if (m_Length == kBufSize && !Flush()) + return -1; + temp_size -= buf_size; buffer += buf_size; } |