mirror of
https://github.com/ppy/osu
synced 2024-12-26 08:53:10 +00:00
Revert inlining of hard link creation into condition
Just feels bad. Mixing data access with actual underlying logic.
This commit is contained in:
parent
d63be3ff17
commit
2c346eae0d
@ -62,9 +62,12 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
private void copyToStore(RealmFile file, Stream data, bool preferHardLinks)
|
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)
|
||||||
if (data is FileStream fs && preferHardLinks && HardLinkHelper.AttemptHardLink(Storage.GetFullPath(file.GetStoragePath(), true), fs.Name))
|
{
|
||||||
return;
|
// 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);
|
data.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user