Inline disturbing getGuestMapper() method

Disturbing because name suggests pure method, but it is in fact `void`
and also performs side effects by about the most confusing means
possible.
This commit is contained in:
Bartłomiej Dach 2023-04-10 15:19:54 +02:00
parent a86a968fac
commit 11fd93a2ba
No known key found for this signature in database

View File

@ -214,22 +214,17 @@ namespace osu.Game.Overlays.BeatmapSet
if (beatmapInfo?.AuthorID != BeatmapSet?.AuthorID)
{
APIUser? user = BeatmapSet?.RelatedUsers?.SingleOrDefault(u => u.OnlineID == beatmapInfo?.AuthorID);
if (user != null)
getGuestMapper(user);
{
guestMapperContainer.AddText("mapped by ");
guestMapperContainer.AddUserLink(user);
}
}
version.Text = beatmapInfo?.DifficultyName ?? string.Empty;
}
private void getGuestMapper(APIUser user)
{
guestMapperContainer.With(d =>
{
d.AddText("mapped by ");
d.AddUserLink(user);
});
}
private void updateDifficultyButtons()
{
Difficulties.Children.ToList().ForEach(diff => diff.State = diff.Beatmap == Beatmap.Value ? DifficultySelectorState.Selected : DifficultySelectorState.NotSelected);