1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 22:27:46 +08:00

Revert inlining of hard link creation into condition

Just feels bad. Mixing data access with actual underlying logic.
This commit is contained in:
Bartłomiej Dach 2022-12-28 21:19:28 +01:00
parent d63be3ff17
commit 2c346eae0d
No known key found for this signature in database

View File

@ -61,10 +61,13 @@ namespace osu.Game.Database
}
private void copyToStore(RealmFile file, Stream data, bool preferHardLinks)
{
if (data is FileStream fs && preferHardLinks)
{
// attempt to do a fast hard link rather than copy.
if (data is FileStream fs && preferHardLinks && HardLinkHelper.AttemptHardLink(Storage.GetFullPath(file.GetStoragePath(), true), fs.Name))
if (HardLinkHelper.AttemptHardLink(Storage.GetFullPath(file.GetStoragePath(), true), fs.Name))
return;
}
data.Seek(0, SeekOrigin.Begin);