1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Simplify contains check to use LINQ the whole way

This commit is contained in:
Dean Herbert 2022-06-10 14:02:58 +09:00
parent c22bffaa01
commit 3b229624dd

View File

@ -35,20 +35,8 @@ namespace osu.Game.Overlays.Music
item.InSelectedCollection = true;
else
{
var beatmapHashes = item.Model.Value.Beatmaps.Select(b => b.MD5Hash);
bool contained = false;
foreach (string hash in beatmapHashes)
{
if (criteria.Collection?.Beatmaps.Contains(hash) == true)
{
contained = true;
break;
}
}
item.InSelectedCollection = contained;
item.InSelectedCollection = item.Model.Value.Beatmaps.Select(b => b.MD5Hash)
.Any(criteria.Collection.Beatmaps.Contains);
}
}