Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address the feedback
  • Loading branch information
tarekgh committed Jul 22, 2021
commit d6512b74ea45b419c15424ee1bc6c256693ae1ff
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public sealed partial class TimeZoneInfo
"Zulu"
};

private static readonly TimeZoneInfo s_utcTimeZone = CreateUtcTimeZone();

private TimeZoneInfo(byte[] data, string id, bool dstDisabled)
{
_id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public sealed partial class TimeZoneInfo
private const int MaxKeyLength = 255;
private const string InvariantUtcStandardDisplayName = "Coordinated Universal Time";

private static readonly TimeZoneInfo s_utcTimeZone = CreateUtcTimeZone();

private sealed partial class CachedData
{
private static TimeZoneInfo GetCurrentOneYearLocal()
Expand Down Expand Up @@ -739,7 +737,7 @@ private static bool TryCompareTimeZoneInformationToRegistry(in TIME_ZONE_INFORMA


/// <summary>
/// Try to find the time zone resources Dll matching the CurrentUICulture or on eof its parent cultures.
/// Try to find the time zone resources Dll matching the CurrentUICulture or one of its parent cultures.
/// We try to check of such resource module e.g. %windir%\system32\[UI Culture Name]\tzres.dll.mui exist.
/// If a localized resource file exists, we LoadString resource with the id specified inside resource input
/// string and and return it to our caller.
Expand Down Expand Up @@ -775,8 +773,8 @@ private static string GetLocalizedNameByMuiNativeResource(string resource)
// get the path to Windows\System32
string system32 = Environment.SystemDirectory;

// trim the string "@tzres.dll" => "tzres.dll"
string tzresDll = resources[0].TrimStart('@') + ".mui";
// trim the string "@tzres.dll" to "tzres.dll" and append the "mui" file extension to it.
string tzresDll = $"{resources[0].AsSpan().TrimStart('@')}.mui";

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private enum TimeZoneInfoResult
private const string UtcId = "UTC";
private const string LocalId = "Local";

private static readonly TimeZoneInfo s_utcTimeZone = CreateUtcTimeZone();
private static CachedData s_cachedData = new CachedData();

//
Expand Down