Simplify CommentsPage.onCommentRepliesReceived

This commit is contained in:
Andrei Zavatski 2020-02-13 03:13:56 +03:00
parent b0db155565
commit 483bbac6fd

View File

@ -126,16 +126,8 @@ namespace osu.Game.Overlays.Comments
private void onCommentRepliesReceived(CommentBundle response, DrawableComment drawableComment) private void onCommentRepliesReceived(CommentBundle response, DrawableComment drawableComment)
{ {
var receivedComments = response.Comments;
var uniqueComments = new List<Comment>();
// We may receive already loaded comments // We may receive already loaded comments
receivedComments.ForEach(c => var uniqueComments = response.Comments.Where(c => !drawableComment.ContainsReply(c.Id)).ToList();
{
if (!drawableComment.ContainsReply(c.Id))
uniqueComments.Add(c);
});
uniqueComments.ForEach(c => c.ParentComment = drawableComment.Comment); uniqueComments.ForEach(c => c.ParentComment = drawableComment.Comment);