Skip to content

Commit 2878b41

Browse files
authored
Stop trimming "redundant" trailing transitions. (#281)
Even when the last two transitions share a type, we should not discard the last transition as that might change the point at which we start to apply the POSIX spec for future transitions. This will start to make a difference in zoneinfo files compiled using the 2023d zic for Antarctica/Macquarie, Europe/Riga, Europe/Tallinn, Europe/Vilnius, and Pacific/Norfolk, where we previously would have added daylight-time transitions in years where they did not really apply.
1 parent 2acd9f2 commit 2878b41

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/time_zone_info.cc

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -765,19 +765,6 @@ bool TimeZoneInfo::Load(ZoneInfoSource* zip) {
765765
version_ = zip->Version();
766766
}
767767

768-
// Trim redundant transitions. zic may have added these to work around
769-
// differences between the glibc and reference implementations (see
770-
// zic.c:dontmerge) or to avoid bugs in old readers. For us, they just
771-
// get in the way when we do future_spec_ extension.
772-
while (hdr.timecnt > 1) {
773-
if (!EquivTransitions(transitions_[hdr.timecnt - 1].type_index,
774-
transitions_[hdr.timecnt - 2].type_index)) {
775-
break;
776-
}
777-
hdr.timecnt -= 1;
778-
}
779-
transitions_.resize(hdr.timecnt);
780-
781768
// Ensure that there is always a transition in the first half of the
782769
// time line (the second half is handled below) so that the signed
783770
// difference between a civil_second and the civil_second of its

0 commit comments

Comments
 (0)