Skip to content

Commit 5e5d61b

Browse files
kumperap12tic
authored andcommitted
Avoid a .cctor on the initialization path.
1 parent bc30703 commit 5e5d61b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mcs/class/corlib/System/TimeZone.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace System
5454
public abstract class TimeZone
5555
{
5656
// Fields
57-
private static TimeZone currentTimeZone = new CurrentSystemTimeZone (DateTime.GetNow ());
57+
static TimeZone currentTimeZone;
5858

5959
// Constructor
6060
protected TimeZone ()
@@ -64,6 +64,8 @@ protected TimeZone ()
6464
// Properties
6565
public static TimeZone CurrentTimeZone {
6666
get {
67+
if (currentTimeZone == null)
68+
currentTimeZone = new CurrentSystemTimeZone (DateTime.GetNow ());
6769
return currentTimeZone;
6870
}
6971
}

0 commit comments

Comments
 (0)