From 67e3dd3c7b98a4e69d1fe2a7451bbb19ebb74eb1 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 25 Apr 2018 21:15:14 +0000 Subject: Use a bool in FindBit() in the fax codec. Change-Id: If75c0db94d341715e0bc6406f0fd89812f1ea73c Reviewed-on: https://pdfium-review.googlesource.com/31311 Commit-Queue: Lei Zhang Commit-Queue: Ryan Harrison Reviewed-by: Ryan Harrison --- core/fxcodec/codec/fx_codec_fax.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp index c800fda283..20280a3760 100644 --- a/core/fxcodec/codec/fx_codec_fax.cpp +++ b/core/fxcodec/codec/fx_codec_fax.cpp @@ -48,7 +48,7 @@ const uint8_t ZeroLeadPos[256] = { // Limit of image dimension, an arbitrary large number. const int kMaxImageDimension = 0x01FFFF; -int FindBit(const uint8_t* data_buf, int max_pos, int start_pos, int bit) { +int FindBit(const uint8_t* data_buf, int max_pos, int start_pos, bool bit) { ASSERT(start_pos >= 0); if (start_pos >= max_pos) return max_pos; @@ -87,8 +87,7 @@ void FaxG4FindB1B2(const std::vector& ref_buf, bool a0color, int* b1, int* b2) { - uint8_t first_bit = - (a0 < 0) ? 1 : ((ref_buf[a0 / 8] & (1 << (7 - a0 % 8))) != 0); + bool first_bit = a0 < 0 || (ref_buf[a0 / 8] & (1 << (7 - a0 % 8))) != 0; *b1 = FindBit(ref_buf.data(), columns, a0 + 1, !first_bit); if (*b1 >= columns) { *b1 = *b2 = columns; -- cgit v1.2.3