mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 17:13:06 +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;
|
item.InSelectedCollection = true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var beatmapHashes = item.Model.Value.Beatmaps.Select(b => b.MD5Hash);
|
item.InSelectedCollection = item.Model.Value.Beatmaps.Select(b => b.MD5Hash)
|
||||||
|
.Any(criteria.Collection.Beatmaps.Contains);
|
||||||
bool contained = false;
|
|
||||||
|
|
||||||
foreach (string hash in beatmapHashes)
|
|
||||||
{
|
|
||||||
if (criteria.Collection?.Beatmaps.Contains(hash) == true)
|
|
||||||
{
|
|
||||||
contained = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
item.InSelectedCollection = contained;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user