summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/fx_basic_buffer.cpp8
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;
}