Invert condition to reduce nesting

This commit is contained in:
Bartłomiej Dach
2021-06-03 13:58:19 +02:00
parent acb4873157
commit 8193691cbc

View File

@ -471,9 +471,10 @@ namespace osu.Game.Online.Chat
ClosedChannel lastClosedChannel = closedChannels.Last();
closedChannels.RemoveAt(closedChannels.Count - 1);
// If the user hasn't already joined the channel, try to join it
if (joinedChannels.FirstOrDefault(lastClosedChannel.IsEqual) == null)
{
// If the user has already joined the channel, try the next one
if (joinedChannels.FirstOrDefault(lastClosedChannel.IsEqual) != null)
continue;
Channel lastChannel = AvailableChannels.FirstOrDefault(lastClosedChannel.IsEqual);
if (lastChannel != null)
@ -495,7 +496,6 @@ namespace osu.Game.Online.Chat
return;
}
}
}
private long lastMessageId;