1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-08 06:19:38 +08:00

Merge pull request #18674 from peppy/remvoe-unnecessary-existing-check

Remove unnecessary file existence check in model import process
This commit is contained in:
Bartłomiej Dach 2022-06-13 12:52:21 +02:00 committed by GitHub
commit 54980cbfc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -521,8 +521,7 @@ namespace osu.Game.Stores
// for the best or worst, we copy and import files of a new import before checking whether
// it is a duplicate. so to check if anything has changed, we can just compare all File IDs.
getIDs(existing.Files).SequenceEqual(getIDs(import.Files)) &&
getFilenames(existing.Files).SequenceEqual(getFilenames(import.Files)) &&
checkAllFilesExist(existing);
getFilenames(existing.Files).SequenceEqual(getFilenames(import.Files));
private bool checkAllFilesExist(TModel model) =>
model.Files.All(f => Files.Storage.Exists(f.File.GetStoragePath()));