mirror of
https://github.com/osukey/osukey.git
synced 2025-05-22 14:07:38 +09:00
invert and early return
This commit is contained in:
parent
8e8458ab8f
commit
7a3315dcf8
@ -14,7 +14,7 @@ namespace osu.Game.Tournament.IO
|
|||||||
private readonly Storage storage;
|
private readonly Storage storage;
|
||||||
internal readonly TournamentVideoResourceStore VideoStore;
|
internal readonly TournamentVideoResourceStore VideoStore;
|
||||||
private const string default_tournament = "default";
|
private const string default_tournament = "default";
|
||||||
|
|
||||||
public TournamentStorage(Storage storage)
|
public TournamentStorage(Storage storage)
|
||||||
: base(storage.GetStorageForDirectory("tournaments"), string.Empty)
|
: base(storage.GetStorageForDirectory("tournaments"), string.Empty)
|
||||||
{
|
{
|
||||||
@ -60,13 +60,13 @@ namespace osu.Game.Tournament.IO
|
|||||||
|
|
||||||
private void moveFileIfExists(string file, DirectoryInfo destination)
|
private void moveFileIfExists(string file, DirectoryInfo destination)
|
||||||
{
|
{
|
||||||
if (storage.Exists(file))
|
if (!storage.Exists(file))
|
||||||
{
|
return;
|
||||||
Logger.Log($"Migrating {file} to default tournament storage.");
|
|
||||||
var fileInfo = new System.IO.FileInfo(storage.GetFullPath(file));
|
Logger.Log($"Migrating {file} to default tournament storage.");
|
||||||
AttemptOperation(() => fileInfo.CopyTo(Path.Combine(destination.FullName, fileInfo.Name), true));
|
var fileInfo = new System.IO.FileInfo(storage.GetFullPath(file));
|
||||||
fileInfo.Delete();
|
AttemptOperation(() => fileInfo.CopyTo(Path.Combine(destination.FullName, fileInfo.Name), true));
|
||||||
}
|
fileInfo.Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user