mirror of
https://github.com/discourse/discourse.git
synced 2025-04-25 22:34:37 +08:00
Avoid allocating an extra array.
This commit is contained in:
parent
0f2a303f00
commit
2db47f98cd
@ -24,7 +24,9 @@ class SuggestedTopicsBuilder
|
|||||||
if @category_id && SiteSetting.limit_suggested_to_category?
|
if @category_id && SiteSetting.limit_suggested_to_category?
|
||||||
results = results.where(category_id: @category_id)
|
results = results.where(category_id: @category_id)
|
||||||
end
|
end
|
||||||
results = results.to_a.reject { |topic| @category_topic_ids.include?(topic.id) }
|
|
||||||
|
results = results.to_a
|
||||||
|
results.reject! { |topic| @category_topic_ids.include?(topic.id) }
|
||||||
|
|
||||||
unless results.empty?
|
unless results.empty?
|
||||||
# Keep track of the ids we've added
|
# Keep track of the ids we've added
|
||||||
|
Loading…
x
Reference in New Issue
Block a user