1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 21:23:04 +08:00

&&=, unnecessary null check

This commit is contained in:
Drew DeVault 2017-01-30 09:49:58 -05:00
parent 9a2cba8520
commit fb431fd44e

View File

@ -201,8 +201,6 @@ namespace osu.Game.Screens.Select
foreach (var beatmapGroup in carousel) foreach (var beatmapGroup in carousel)
{ {
var set = beatmapGroup.BeatmapSet; var set = beatmapGroup.BeatmapSet;
if (set == null)
continue;
bool match = string.IsNullOrEmpty(search) bool match = string.IsNullOrEmpty(search)
|| (set.Metadata.Artist ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1 || (set.Metadata.Artist ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1
|| (set.Metadata.ArtistUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1 || (set.Metadata.ArtistUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1
@ -210,14 +208,14 @@ namespace osu.Game.Screens.Select
|| (set.Metadata.TitleUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1; || (set.Metadata.TitleUnicode ?? "").IndexOf(search, StringComparison.InvariantCultureIgnoreCase) != -1;
if (match) if (match)
{ {
changed = changed && !beatmapGroup.Hidden; changed &= !beatmapGroup.Hidden;
beatmapGroup.Hidden = false; beatmapGroup.Hidden = false;
if (newSelection == null || beatmapGroup.BeatmapSet.OnlineBeatmapSetID == Beatmap.BeatmapSetInfo.OnlineBeatmapSetID) if (newSelection == null || beatmapGroup.BeatmapSet.OnlineBeatmapSetID == Beatmap.BeatmapSetInfo.OnlineBeatmapSetID)
newSelection = beatmapGroup; newSelection = beatmapGroup;
} }
else else
{ {
changed = changed && beatmapGroup.Hidden; changed &= beatmapGroup.Hidden;
beatmapGroup.Hidden = true; beatmapGroup.Hidden = true;
} }
} }