optimize<User>: reduce memory used by commit's author/committer data

This commit is contained in:
leo 2023-10-10 11:25:57 +08:00
parent d9afb798db
commit 766f24f4b0
14 changed files with 91 additions and 41 deletions

View file

@ -1,11 +1,18 @@
using System;
namespace SourceGit.Models {
/// <summary>
/// 贮藏
/// </summary>
public class Stash {
private static readonly DateTime UTC_START = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).ToLocalTime();
public string Name { get; set; } = "";
public string SHA { get; set; } = "";
public User Author { get; set; } = new User();
public User Author { get; set; } = User.Invalid;
public ulong Time { get; set; } = 0;
public string Message { get; set; } = "";
public string TimeStr => UTC_START.AddSeconds(Time).ToString("yyyy-MM-dd HH:mm:ss");
}
}