From 37d27c4c99486312d9a282d7fc056c657efe0848 Mon Sep 17 00:00:00 2001 From: Berkan Diler Date: Sat, 24 Dec 2022 18:30:39 +0100 Subject: Some minor cleanups and optimizations (#4174) * Replace Array.Clear(x, 0, x.Length) with Array.Clear(x) * Use DateTime.UnixEpoch field * Replace SHA256.ComputeHash calls with static SHA256.HashData call More performant and avoids the need to initialize a SHA256 instance. --- Ryujinx.HLE/HOS/Services/Time/Clock/Types/TimeSpanType.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Time/Clock') diff --git a/Ryujinx.HLE/HOS/Services/Time/Clock/Types/TimeSpanType.cs b/Ryujinx.HLE/HOS/Services/Time/Clock/Types/TimeSpanType.cs index 94c1b488..0070193f 100644 --- a/Ryujinx.HLE/HOS/Services/Time/Clock/Types/TimeSpanType.cs +++ b/Ryujinx.HLE/HOS/Services/Time/Clock/Types/TimeSpanType.cs @@ -10,8 +10,6 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock public static readonly TimeSpanType Zero = new TimeSpanType(0); - private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - public long NanoSeconds; public TimeSpanType(long nanoSeconds) @@ -31,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock public bool IsDaylightSavingTime() { - return UnixEpoch.AddSeconds(ToSeconds()).ToLocalTime().IsDaylightSavingTime(); + return DateTime.UnixEpoch.AddSeconds(ToSeconds()).ToLocalTime().IsDaylightSavingTime(); } public static TimeSpanType FromSeconds(long seconds) -- cgit v1.2.3