A platform for community discussion. Free, open, simple.
PERF: Memoize `TopicView#gaps` results.
Guo Xiang Tan5cef4e281be6
diff --git a/lib/topic_view.rb b/lib/topic_view.rbindex cc06d251282..2b3dc236c4f 100644--- a/lib/topic_view.rb+++ b/lib/topic_view.rb@@ -103,7 +103,7 @@ class TopicViewdef gapsreturn unless @contains_gaps- Gaps.new(filtered_post_ids, unfiltered_posts.order(:sort_order).pluck(:id))+ @gaps ||= Gaps.new(filtered_post_ids, unfiltered_posts.order(:sort_order).pluck(:id))enddef last_post