Replace some x ? true : false with boolean expressions.

Change-Id: I446cb7fe02755861a927e6a57c2e541bcff857ab
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/89790
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_read_validator.cpp b/core/fpdfapi/parser/cpdf_read_validator.cpp
index b87d940..c02268f 100644
--- a/core/fpdfapi/parser/cpdf_read_validator.cpp
+++ b/core/fpdfapi/parser/cpdf_read_validator.cpp
@@ -113,8 +113,7 @@
   const FX_SAFE_SIZE_T safe_size = file_size_;
   whole_file_already_available_ =
       whole_file_already_available_ ||
-      (safe_size.IsValid() ? IsDataRangeAvailable(0, safe_size.ValueOrDie())
-                           : false);
+      (safe_size.IsValid() && IsDataRangeAvailable(0, safe_size.ValueOrDie()));
 
   return whole_file_already_available_;
 }
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp
index 6bdcf9f..b21924a 100644
--- a/core/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/fxcodec/jbig2/JBig2_Context.cpp
@@ -346,7 +346,7 @@
         return JBig2_Result::kFailure;
       }
 
-      m_pPage->Fill((pPageInfo->m_cFlags & 4) ? true : false);
+      m_pPage->Fill(!!(pPageInfo->m_cFlags & 4));
       m_PageInfoList.push_back(std::move(pPageInfo));
       m_bInPage = true;
     } break;
@@ -803,8 +803,7 @@
       const auto& pPageInfo = m_PageInfoList.back();
       if ((pPageInfo->m_bIsStriped == 1) &&
           (ri.y + ri.height > m_pPage->height())) {
-        m_pPage->Expand(ri.y + ri.height,
-                        (pPageInfo->m_cFlags & 4) ? true : false);
+        m_pPage->Expand(ri.y + ri.height, !!(pPageInfo->m_cFlags & 4));
       }
     }
     m_pPage->ComposeFrom(ri.x, ri.y, pSegment->m_Image.get(),
@@ -920,8 +919,7 @@
       const auto& pPageInfo = m_PageInfoList.back();
       if (pPageInfo->m_bIsStriped == 1 &&
           ri.y + ri.height > m_pPage->height()) {
-        m_pPage->Expand(ri.y + ri.height,
-                        (pPageInfo->m_cFlags & 4) ? true : false);
+        m_pPage->Expand(ri.y + ri.height, !!(pPageInfo->m_cFlags & 4));
       }
     }
     m_pPage->ComposeFrom(ri.x, ri.y, pSegment->m_Image.get(),
@@ -988,7 +986,7 @@
             if ((pPageInfo->m_bIsStriped == 1) &&
                 (m_ri.y + m_ri.height > m_pPage->height())) {
               m_pPage->Expand(m_ri.y + m_ri.height,
-                              (pPageInfo->m_cFlags & 4) ? true : false);
+                              !!(pPageInfo->m_cFlags & 4));
             }
           }
           const FX_RECT& rect = m_pGRD->GetReplaceRect();
@@ -1021,8 +1019,7 @@
       JBig2PageInfo* pPageInfo = m_PageInfoList.back().get();
       if ((pPageInfo->m_bIsStriped == 1) &&
           (m_ri.y + m_ri.height > m_pPage->height())) {
-        m_pPage->Expand(m_ri.y + m_ri.height,
-                        (pPageInfo->m_cFlags & 4) ? true : false);
+        m_pPage->Expand(m_ri.y + m_ri.height, !!(pPageInfo->m_cFlags & 4));
       }
     }
     const FX_RECT& rect = m_pGRD->GetReplaceRect();
@@ -1095,8 +1092,7 @@
       JBig2PageInfo* pPageInfo = m_PageInfoList.back().get();
       if ((pPageInfo->m_bIsStriped == 1) &&
           (ri.y + ri.height > m_pPage->height())) {
-        m_pPage->Expand(ri.y + ri.height,
-                        (pPageInfo->m_cFlags & 4) ? true : false);
+        m_pPage->Expand(ri.y + ri.height, !!(pPageInfo->m_cFlags & 4));
       }
     }
     m_pPage->ComposeFrom(ri.x, ri.y, pSegment->m_Image.get(),
diff --git a/fxjs/cjs_field.cpp b/fxjs/cjs_field.cpp
index 976ee6c..318d062 100644
--- a/fxjs/cjs_field.cpp
+++ b/fxjs/cjs_field.cpp
@@ -887,8 +887,8 @@
   if (!pFormControl)
     return CJS_Result::Failure(JSMessage::kBadObjectError);
 
-  return CJS_Result::Success(pRuntime->NewBoolean(
-      pFormControl->GetIconFit().IsProportionalScale() ? false : true));
+  return CJS_Result::Success(
+      pRuntime->NewBoolean(!pFormControl->GetIconFit().IsProportionalScale()));
 }
 
 CJS_Result CJS_Field::set_button_scale_how(CJS_Runtime* pRuntime,