Commit 6a1b41ca authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

Fix DateCache::DaylightSavingsOffsetInMs fallback path.

The code after the binary-search loop is unlikely to be reached,
but not actually UNREACHABLE(). Restore the "return 0" that was
there until a cleanup [1] removed it.

[1] crrev.com/c/507287/2/src/date.cc

Bug: chromium:767039
Change-Id: I9e007d3b7d693d4866ccc3e3cf2b71e78e9bd07f
Reviewed-on: https://chromium-review.googlesource.com/675755Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48117}
parent 7558c759
......@@ -310,7 +310,7 @@ int DateCache::DaylightSavingsOffsetInMs(int64_t time_ms) {
}
// Binary search for daylight savings offset change point,
// but give up if we don't find it in four iterations.
// but give up if we don't find it in five iterations.
for (int i = 4; i >= 0; --i) {
int delta = after_->start_sec - before_->end_sec;
int middle_sec = (i == 0) ? time_sec : before_->end_sec + delta / 2;
......@@ -332,7 +332,7 @@ int DateCache::DaylightSavingsOffsetInMs(int64_t time_ms) {
}
}
}
UNREACHABLE();
return 0;
}
......
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