設定の範囲と容量の単位を定数から導く

このコミットが含まれているのは:
routersys committed 2026-11-01 13:13:59 +09:00
1 親 c125342fbf
コミット b4179dec4d
5ファイル変更
+37 -11

検索条件に一致するファイルはありません

+5 -1
ファイルの表示
@@ -10,6 +10,10 @@ internal sealed class UndoTreeRecordStore(string directory)
{
const string Extension = ".json";
const string TemporaryExtension = ".tmp";
const int NameLength = 32;
public const long BytesPerKilobyte = 1024;
public const long BytesPerMegabyte = BytesPerKilobyte * BytesPerKilobyte;
static readonly Lazy<UndoTreeRecordStore> DefaultStore = new(() => new UndoTreeRecordStore(Path.Combine(AppDirectories.UserResourceDirectory, "cache", "UndoTree")));
static readonly JsonSerializerOptions Options = new() { WriteIndented = false };
@@ -24,7 +28,7 @@ internal sealed class UndoTreeRecordStore(string directory)
{
var normalized = Path.GetFullPath(projectPath).ToUpperInvariant();
var hash = Convert.ToHexString(SHA256.HashData(Encoding.UTF8.GetBytes(normalized)));
return Path.Combine(Directory, hash[..32] + Extension);
return Path.Combine(Directory, hash[..NameLength] + Extension);
}
public bool Exists(string projectPath)