[PATCH 50/59] Remove use_last label from __tzfile_compute
Paul Eggert
eggert@cs.ucla.edu
Sun Jan 5 05:57:25 GMT 2025
* time/tzfile.c (__tzfile_compute): Redo last-transition check
so that there is no need for the use_last label or goto.
---
time/tzfile.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/time/tzfile.c b/time/tzfile.c
index e491df7d9f..8b5faad424 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -614,18 +614,16 @@ __tzfile_compute (__time64_t timer, int use_localtime,
}
else if (timecnt == 0 || timer >= transitions[timecnt - 1])
{
- if (__glibc_unlikely (tzspec == NULL))
+ /* TIMER is after the last transition. Do not use the TZ
+ string if it is absent or if we cannot convert to the
+ broken down structure. */
+ if (__glibc_unlikely (tzspec == NULL)
+ || __glibc_unlikely (__offtime (timer, 0, 0, tp) == NULL))
{
- use_last:
i = timecnt;
goto found;
}
- /* Convert to broken down structure. If this fails do not
- use the string. */
- if (__glibc_unlikely (__offtime (timer, 0, 0, tp) == NULL))
- goto use_last;
-
/* Use the rules from the TZ string to compute the change. */
__tz_compute (timer, tp);
--
2.45.2
More information about the Libc-alpha
mailing list