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

@ -62,9 +62,12 @@ namespace osu.Game.Database
private void copyToStore(RealmFile file, Stream data, bool 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))
return;
if (data is FileStream fs && preferHardLinks)
{
// attempt to do a fast hard link rather than copy.
if (HardLinkHelper.AttemptHardLink(Storage.GetFullPath(file.GetStoragePath(), true), fs.Name))
return;
}
data.Seek(0, SeekOrigin.Begin);