invert and early return

This commit is contained in:
Shivam 2020-06-24 00:00:21 +02:00
parent 8e8458ab8f
commit 7a3315dcf8

View File

@ -60,13 +60,13 @@ namespace osu.Game.Tournament.IO
private void moveFileIfExists(string file, DirectoryInfo destination)
{
if (storage.Exists(file))
{
Logger.Log($"Migrating {file} to default tournament storage.");
var fileInfo = new System.IO.FileInfo(storage.GetFullPath(file));
AttemptOperation(() => fileInfo.CopyTo(Path.Combine(destination.FullName, fileInfo.Name), true));
fileInfo.Delete();
}
if (!storage.Exists(file))
return;
Logger.Log($"Migrating {file} to default tournament storage.");
var fileInfo = new System.IO.FileInfo(storage.GetFullPath(file));
AttemptOperation(() => fileInfo.CopyTo(Path.Combine(destination.FullName, fileInfo.Name), true));
fileInfo.Delete();
}
}
}