PERF: Remove unnecessary query from `TopicQuery.remove_muted_tags` (#19586)
When `default_tags_muted` site settings has not been set, there is no need to execute the query.
This commit is contained in:
parent
b756866334
commit
a8ee56ebee
|
@ -899,8 +899,11 @@ class TopicQuery
|
||||||
muted_tag_ids = TagUser.lookup(user, :muted).pluck(:tag_id)
|
muted_tag_ids = TagUser.lookup(user, :muted).pluck(:tag_id)
|
||||||
else
|
else
|
||||||
muted_tag_names = SiteSetting.default_tags_muted.split("|")
|
muted_tag_names = SiteSetting.default_tags_muted.split("|")
|
||||||
|
|
||||||
|
if muted_tag_names.present?
|
||||||
muted_tag_ids = Tag.where(name: muted_tag_names).pluck(:id)
|
muted_tag_ids = Tag.where(name: muted_tag_names).pluck(:id)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if muted_tag_ids.blank?
|
if muted_tag_ids.blank?
|
||||||
return list
|
return list
|
||||||
|
|
Loading…
Reference in New Issue