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,8 +60,9 @@ 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."); Logger.Log($"Migrating {file} to default tournament storage.");
var fileInfo = new System.IO.FileInfo(storage.GetFullPath(file)); var fileInfo = new System.IO.FileInfo(storage.GetFullPath(file));
AttemptOperation(() => fileInfo.CopyTo(Path.Combine(destination.FullName, fileInfo.Name), true)); AttemptOperation(() => fileInfo.CopyTo(Path.Combine(destination.FullName, fileInfo.Name), true));
@ -69,4 +70,3 @@ namespace osu.Game.Tournament.IO
} }
} }
} }
}