commit 625afe418151de1015483ed24acaa57e1f85efb3 from: Sergey Bronnikov via: Sergey Kaplun date: Mon Aug 05 18:08:11 2024 UTC datetime: remove unused function datetime_gmtoff The function `datetime_gmtoff()` has been introduced in commit aec6fbac1f22 ("datetime: implement date.isdst") for a function `datetime_increment_by()`. In commit 6ca072853034 ("datetime: fix interval arithmetic for DST") the function `datetime_increment_by()` has been updated and call of the function `datetime_gmtoff()` was removed. `datetime_gmtoff` is dead code now. The patch removes `datetime_gmtoff()`. NO_CHANGELOG=codehealth NO_DOC=codehealth NO_TEST=codehealth commit - c9c5b9f139ccbf5372d1568827fbb50bec7239bb commit + 625afe418151de1015483ed24acaa57e1f85efb3 blob - 36d50fe0fbacfed9d1b72b02322a6ed6979c3780 blob + a66ed101cab29fbd0ecfa8108187eef628fbfb90 --- src/lib/core/datetime.c +++ src/lib/core/datetime.c @@ -78,16 +78,6 @@ datetime_isdst(const struct datetime *date) epoch_timezone_lookup(date->epoch, date->tzindex, &gmtoff, &isdst); return isdst != 0; -} - -long -datetime_gmtoff(const struct datetime *date) -{ - int isdst = 0; - long gmtoff = date->tzoffset * 60; - - epoch_timezone_lookup(date->epoch, date->tzindex, &gmtoff, &isdst); - return gmtoff; } void blob - af831e0a25899d62405ecd6cbfc8e9ef3af7dbf8 blob + d45c990af5148a1c20da52a4d7b0c5419a9b34ba --- src/lib/core/datetime.h +++ src/lib/core/datetime.h @@ -185,12 +185,6 @@ tm_to_datetime(struct tnt_tm *tm, struct datetime *dat */ bool datetime_isdst(const struct datetime *date); - -/** - * Return gmtoff of a given @sa datetime moment. - */ -long -datetime_gmtoff(const struct datetime *date); /** * Parse datetime text in ISO-8601 given format, and construct output