1999-03-30  Ulrich Drepper  <drepper@cygnus.com>

	* time/tzfile.c (__tzfile_read): Process transitions from the rear.
	Minor optimization.
This commit is contained in:
Ulrich Drepper 1999-03-30 18:35:32 +00:00
parent 57de50372c
commit d334507326
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
1999-03-30 Ulrich Drepper <drepper@cygnus.com>
* time/tzfile.c (__tzfile_read): Process transitions from the rear.
Minor optimization.
1999-03-29 Ulrich Drepper <drepper@cygnus.com>
* elf/rtld.c (process_envvars): Do not automatically prevent lazy

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
/* Copyright (C) 1991,92,93,95,96,97,98,99 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -284,10 +284,11 @@ __tzfile_read (const char *file)
{
int type = type_idxs[--i];
int dst = types[type].isdst;
int idx = types[type].idx;
if (__tzname[dst] == NULL)
{
int idx = types[type].idx;
__tzname[dst] = __tzstring (&zone_names[idx]);
if (__tzname[1 - dst] != NULL)
@ -313,14 +314,15 @@ __tzfile_read (const char *file)
{
int stdoff_set = 0, dstoff_set = 0;
rule_stdoff = rule_dstoff = 0;
for (i = 0; i < num_transitions; ++i)
i = num_transitions - 1;
do
{
if (!stdoff_set && !types[type_idxs[i]].isdst)
{
stdoff_set = 1;
rule_stdoff = types[type_idxs[i]].offset;
}
if (!dstoff_set && types[type_idxs[i]].isdst)
else if (!dstoff_set && types[type_idxs[i]].isdst)
{
dstoff_set = 1;
rule_dstoff = types[type_idxs[i]].offset;
@ -328,6 +330,8 @@ __tzfile_read (const char *file)
if (stdoff_set && dstoff_set)
break;
}
while (i-- > 0);
if (!dstoff_set)
rule_dstoff = rule_stdoff;
}