From e02e5a4f2d63ce136da5db7eb8a4e60437f34c75 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 12 Aug 2017 10:00:07 -0700 Subject: [PATCH] Speed up last long reply sorting. --- src/General/Index.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index e2ccf6e37..b12b82961 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -817,8 +817,11 @@ Index = if len >= Index.lastLongThresholds[+!!r.ext] return r if thread.omitted_posts then thread.last_replies[0] else thread + lastlongD = {} + for thread in liveThreadData + lastlongD[thread.no] = lastlong(thread).no [liveThreadData...].sort((a, b) -> - lastlong(b).no - lastlong(a).no + lastlongD[b.no] - lastlongD[a.no] ).map (post) -> post.no when 'bump' then liveThreadIDs when 'birth' then [liveThreadIDs... ].sort (a, b) -> b - a