Make ConvertColorScale return void instead of bool. The return value is never used. -- Invert early return since it is now a one-liner. Change-Id: Ibc78a872b0ef6bbc3d0110ac6bcd82ecd9b09c88 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/129550 Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Thomas Sepez <tsepez@google.com> Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxge/dib/cfx_dibitmap.cpp b/core/fxge/dib/cfx_dibitmap.cpp index f888bb5..e37626c 100644 --- a/core/fxge/dib/cfx_dibitmap.cpp +++ b/core/fxge/dib/cfx_dibitmap.cpp
@@ -508,12 +508,10 @@ } } -bool CFX_DIBitmap::ConvertColorScale(uint32_t forecolor, uint32_t backcolor) { - if (!m_pBuffer || IsMaskFormat()) - return false; - - ConvertBGRColorScale(forecolor, backcolor); - return true; +void CFX_DIBitmap::ConvertColorScale(uint32_t forecolor, uint32_t backcolor) { + if (m_pBuffer && !IsMaskFormat()) { + ConvertBGRColorScale(forecolor, backcolor); + } } // static
diff --git a/core/fxge/dib/cfx_dibitmap.h b/core/fxge/dib/cfx_dibitmap.h index 0d4ff42..752765e 100644 --- a/core/fxge/dib/cfx_dibitmap.h +++ b/core/fxge/dib/cfx_dibitmap.h
@@ -147,7 +147,7 @@ int height, uint32_t color); - bool ConvertColorScale(uint32_t forecolor, uint32_t backcolor); + void ConvertColorScale(uint32_t forecolor, uint32_t backcolor); // |width| and |height| must be greater than 0. // |format| must have a valid bits per pixel count.