1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 09:37:23 +08:00

Rename variables and remove unnecessary nested call to GetFullPath

This commit is contained in:
Dean Herbert 2022-06-15 15:05:51 +09:00
parent 3d638abc52
commit cca7633e59

View File

@ -18,19 +18,19 @@ namespace osu.Game.Database
protected override IEnumerable<string> GetStableImportPaths(Storage storage) protected override IEnumerable<string> GetStableImportPaths(Storage storage)
{ {
foreach (string beatmapDirectory in storage.GetDirectories(string.Empty)) foreach (string directory in storage.GetDirectories(string.Empty))
{ {
var beatmapStorage = storage.GetStorageForDirectory(beatmapDirectory); var directoryStorage = storage.GetStorageForDirectory(directory);
if (!beatmapStorage.GetFiles(string.Empty).ExcludeSystemFileNames().Any()) if (!directoryStorage.GetFiles(string.Empty).ExcludeSystemFileNames().Any())
{ {
// if a directory doesn't contain files, attempt looking for beatmaps inside of that directory. // if a directory doesn't contain files, attempt looking for beatmaps inside of that directory.
// this is a special behaviour in stable for beatmaps only, see https://github.com/ppy/osu/issues/18615. // this is a special behaviour in stable for beatmaps only, see https://github.com/ppy/osu/issues/18615.
foreach (string beatmapInDirectory in GetStableImportPaths(beatmapStorage)) foreach (string subDirectory in GetStableImportPaths(directoryStorage))
yield return beatmapStorage.GetFullPath(beatmapInDirectory); yield return subDirectory;
} }
else else
yield return storage.GetFullPath(beatmapDirectory); yield return storage.GetFullPath(directory);
} }
} }