mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
CommentTreeStorageBase.add_comments: Sort comments before processing
This commit is contained in:
@@ -99,7 +99,9 @@ class CommentTreeStorageBase(object):
|
||||
depth = tree.depth
|
||||
|
||||
new_parents = {}
|
||||
for comment in comments:
|
||||
for comment in sorted(comments, key=lambda c: c._id):
|
||||
# sort the comments by id so we'll process a parent comment before
|
||||
# its child
|
||||
cid = comment._id
|
||||
p_id = comment.parent_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user