A platform for community discussion. Free, open, simple.
PERF: Remove unnecessary query from `TopicQuery.remove_muted_tags` (#19586)
Alan Guo Xiang Tana8ee56ebee6d
diff --git a/lib/topic_query.rb b/lib/topic_query.rbindex c5b5b84b94e..635f05c7d7a 100644--- a/lib/topic_query.rb+++ b/lib/topic_query.rb@@ -899,7 +899,10 @@ class TopicQuerymuted_tag_ids = TagUser.lookup(user, :muted).pluck(:tag_id)elsemuted_tag_names = SiteSetting.default_tags_muted.split("|")- muted_tag_ids = Tag.where(name: muted_tag_names).pluck(:id)++ if muted_tag_names.present?+ muted_tag_ids = Tag.where(name: muted_tag_names).pluck(:id)+ endendif muted_tag_ids.blank?