From 367b314df680ba33e8e9797760df726688bbc7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Mon, 2 Aug 2021 19:34:53 +0200 Subject: [PATCH] Linter --- base/common/DateLUTImpl.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/base/common/DateLUTImpl.h b/base/common/DateLUTImpl.h index 25d15ac01b9..19407226bb5 100644 --- a/base/common/DateLUTImpl.h +++ b/base/common/DateLUTImpl.h @@ -473,7 +473,7 @@ public: } LUTIndex index = findIndex(t); - UInt32 time = t - lut[index].date; + Time time = t - lut[index].date; if (time >= lut[index].time_at_offset_change()) time += lut[index].amount_of_offset_change(); @@ -493,12 +493,15 @@ public: /// also make the special timezones with no whole hour offset such as 'Australia/Lord_Howe' been taken into account. LUTIndex index = findIndex(t); - UInt32 time = t - lut[index].date; + Time time = t - lut[index].date; if (time >= lut[index].time_at_offset_change()) time += lut[index].amount_of_offset_change(); - return time / 60 % 60; + Time res = time / 60 % 60; + if (likely(res >= 0)) + return res; + return res + 60; } /// NOTE: Assuming timezone offset is a multiple of 15 minutes.