# HG changeset patch # User neko259 # Date 2015-02-09 09:27:47 # Node ID 68e7bfc6c078d91f81d7e4bb32a06277d6a0e99b # Parent 3cd64ae8dc1e244f109d1914758cd16b1f5ac26b Use more efficient way to get last replies diff --git a/boards/models/thread.py b/boards/models/thread.py --- a/boards/models/thread.py +++ b/boards/models/thread.py @@ -102,7 +102,7 @@ class Thread(models.Model): reply_count_to_show = min(settings.LAST_REPLIES_COUNT, reply_count - 1) replies = self.get_replies() - last_replies = replies[reply_count - reply_count_to_show:] + last_replies = replies.reverse()[:reply_count_to_show] return last_replies