[utils] Remove BoolToInt helper

This function is trivial, can and be inlined to the single use.
This makes utils.h a tiny little bit smaller.

R=verwaest@chromium.org

Bug: v8:9810, v8:8912
Change-Id: I877f3713530644a1cb9e0f286cf87f55072d33da
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1903444
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64850}
This commit is contained in:
Clemens Backes 2019-11-07 15:45:02 +01:00 committed by Commit Bot
parent 77a2b4c18b
commit 2a32d96bd2
2 changed files with 2 additions and 4 deletions

View File

@ -128,8 +128,8 @@ void DateCache::YearMonthDayFromDays(int days, int* year, int* month,
days += is_leap;
// Check if the date is after February.
if (days >= 31 + 28 + BoolToInt(is_leap)) {
days -= 31 + 28 + BoolToInt(is_leap);
if (days >= 31 + 28 + (is_leap ? 1 : 0)) {
days -= 31 + 28 + (is_leap ? 1 : 0);
// Find the date starting from March.
for (int i = 2; i < 12; i++) {
if (days < kDaysInMonths[i]) {

View File

@ -53,8 +53,6 @@ inline char HexCharOfValue(int value) {
return value - 10 + 'A';
}
inline int BoolToInt(bool b) { return b ? 1 : 0; }
// Checks if value is in range [lower_limit, higher_limit] using a single
// branch.
template <typename T, typename U>