mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:52:57 +08:00
Simplify contains check to use LINQ the whole way
This commit is contained in:
parent
c22bffaa01
commit
3b229624dd
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user