Binary Search in TimeZoneInfo.GetAdjustmentRuleForTime
authorEric Erhardt <eric.erhardt@microsoft.com>
Mon, 27 Mar 2017 17:50:36 +0000 (12:50 -0500)
committerEric Erhardt <eric.erhardt@microsoft.com>
Tue, 28 Mar 2017 14:16:32 +0000 (09:16 -0500)
commitf01ef48439fb2937917a2fa60d62e39d0135f7d5
tree65461499039b3a49e5cfba6f35e2d2af4979c00b
parentd1555e372a2c36660017f4f918032166d842085f
Binary Search in TimeZoneInfo.GetAdjustmentRuleForTime

Since Unix uses IANA tzdata files, there can be hundreds of adjustment rules for each time zone.  To make the search for a given rule faster, use a binary search since the rules are guaranteed to be in chronological order.  See ValidateTimeZoneInfo.

Fix dotnet/coreclr#5716

Commit migrated from https://github.com/dotnet/coreclr/commit/8db6c57bc9768b0387cb045b19afee3c721ea348
src/coreclr/src/mscorlib/src/System/TimeZoneInfo.cs