Skip to content

A platform for community discussion. Free, open, simple.

PERF: Update `TopicView#participant_count` to use `Topic#posts_count`.

Guo Xiang Taneb427f7cf4bf
diff --git a/lib/topic_view.rb b/lib/topic_view.rb
index be2819d8e1e..09c9b2620ec 100644
--- a/lib/topic_view.rb
+++ b/lib/topic_view.rb
@@ -310,7 +310,7 @@ class TopicView
@participant_count ||=
begin
if participants.size == MAX_PARTICIPANTS
- if unfiltered_post_ids.length > MAX_POSTS_COUNT_PARTICIPANTS
+ if @topic.posts_count > MAX_POSTS_COUNT_PARTICIPANTS
@topic.participant_count
else
sql = <<~SQL