Commit 54780211 by Abseil Team Committed by Copybara-Service

Import of CCTZ from GitHub.

PiperOrigin-RevId: 467992681
Change-Id: I086b3da8dd95b0498d5bc118b9243052586239e6
parent f4b2faaa
...@@ -349,7 +349,6 @@ bool TimeZoneInfo::ExtendTransitions() { ...@@ -349,7 +349,6 @@ bool TimeZoneInfo::ExtendTransitions() {
PosixTimeZone posix; PosixTimeZone posix;
if (!ParsePosixSpec(future_spec_, &posix)) return false; if (!ParsePosixSpec(future_spec_, &posix)) return false;
if (AllYearDST(posix)) return true; // last transition still prevails
// Find transition type for the future std specification. // Find transition type for the future std specification.
std::uint_least8_t std_ti; std::uint_least8_t std_ti;
...@@ -367,6 +366,12 @@ bool TimeZoneInfo::ExtendTransitions() { ...@@ -367,6 +366,12 @@ bool TimeZoneInfo::ExtendTransitions() {
if (!GetTransitionType(posix.dst_offset, true, posix.dst_abbr, &dst_ti)) if (!GetTransitionType(posix.dst_offset, true, posix.dst_abbr, &dst_ti))
return false; return false;
if (AllYearDST(posix)) { // dst only
// The future specification should match the last transition, and
// that means that handling the future will fall out naturally.
return EquivTransitions(transitions_.back().type_index, dst_ti);
}
// Extend the transitions for an additional 400 years using the // Extend the transitions for an additional 400 years using the
// future specification. Years beyond those can be handled by // future specification. Years beyond those can be handled by
// mapping back to a cycle-equivalent year within that range. // mapping back to a cycle-equivalent year within that range.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment