Commit 2a32d96b authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[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/+/1903444Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64850}
parent 77a2b4c1
......@@ -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]) {
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment