[PATCH 55/59] Refactor __tzfile_compute index local
Paul Eggert
eggert@cs.ucla.edu
Sun Jan 5 05:57:30 GMT 2025
* time/tzfile.c (__tzfile_compute): Avoid portmanteau index local.
---
time/tzfile.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/time/tzfile.c b/time/tzfile.c
index 0ee70fd356..bed62d877f 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -643,12 +643,10 @@ __tzfile_compute (__time64_t timer, int use_localtime,
int *leap_correct, bool *leap_hit,
struct tm *tp)
{
- tzidx i;
-
/* Find the last leap second correction transition time before TIMER. */
int corr = 0;
bool hit = false;
- for (i = leapcnt; 0 < i; )
+ for (tzidx i = leapcnt; 0 < i; )
{
i--;
if (leaps[i].occur <= timer)
@@ -679,7 +677,7 @@ __tzfile_compute (__time64_t timer, int use_localtime,
}
else
{
- i = first_transition_after (timer);
+ tzidx i = first_transition_after (timer);
if (i == timecnt)
{
/* TIMER is after the last transition, or there are no transitions
--
2.45.2
More information about the Libc-alpha
mailing list