Cache the last modified date in NativeFileStreamFactory

This commit is contained in:
Timothy Baldridge 2021-07-05 23:26:08 -06:00
parent 5370d19a8d
commit 2c490f50e7

View File

@ -34,7 +34,16 @@ namespace Wabbajack.Common
return await _file.OpenRead();
}
public DateTime LastModifiedUtc => _file.LastModifiedUtc;
private DateTime? _lastModifiedCache = null;
public DateTime LastModifiedUtc
{
get
{
_lastModifiedCache ??= _file.LastModifiedUtc;
return _lastModifiedCache.Value;
}
}
public IPath Name { get; }
}