Ensure using single Utc object in TimeZoneInfo (#24614)
authorTarek Mahmoud Sayed <tarekms@microsoft.com>
Fri, 17 May 2019 15:49:20 +0000 (08:49 -0700)
committerGitHub <noreply@github.com>
Fri, 17 May 2019 15:49:20 +0000 (08:49 -0700)
commitd85920c017bfea9bd50889eb6f3bd7329f9eb3e0
tree21942a343bdf85c5b93fddacee338d87410c1345
parent1e90c98504feaaa7ca4bd022a49d911904b64de8
Ensure using single Utc object in TimeZoneInfo (#24614)

Currently if calling GetSystemTimeZones, will return a list which in include Utc object created from the enumeration.  But when calling FindSystemTimeZoneById("UTC") will return the cached Utc object which is different than the one returned from the enumeration. This in general could be not a problem but it is better to ensure returned the same object from both APIs. The reason is in our internal code, we use some reference equality for the perf reason. Ensure the usage of Utc object will make it more reliable.
src/System.Private.CoreLib/shared/System/TimeZoneInfo.Win32.cs
src/System.Private.CoreLib/shared/System/TimeZoneInfo.cs