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:
Berkan Diler 2022-12-24 18:30:39 +01:00 committed by GitHub
parent f906eb06c2
commit 37d27c4c99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 33 deletions

View file

@ -4,8 +4,6 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
{
public class UserProfile
{
private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
public UserId UserId { get; }
public long LastModifiedTimestamp { get; set; }
@ -83,7 +81,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
private void UpdateLastModifiedTimestamp()
{
LastModifiedTimestamp = (long)(DateTime.Now - Epoch).TotalSeconds;
LastModifiedTimestamp = (long)(DateTime.Now - DateTime.UnixEpoch).TotalSeconds;
}
}
}