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.
This commit is contained in:
parent
f906eb06c2
commit
37d27c4c99
6 changed files with 19 additions and 33 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue