mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Remove Object#present?
check introduced in e0d5d9670a
.
This commit is contained in:
parent
7d350d0d75
commit
58321d0783
@ -15,7 +15,7 @@ class FilterBestPosts
|
|||||||
def filter
|
def filter
|
||||||
@posts =
|
@posts =
|
||||||
if @min_replies && @topic.posts_count < @min_replies + 1
|
if @min_replies && @topic.posts_count < @min_replies + 1
|
||||||
[]
|
Post.none
|
||||||
else
|
else
|
||||||
filter_posts_liked_by_moderators
|
filter_posts_liked_by_moderators
|
||||||
setup_posts
|
setup_posts
|
||||||
|
@ -66,7 +66,7 @@ class TopicView
|
|||||||
|
|
||||||
filter_posts(options)
|
filter_posts(options)
|
||||||
|
|
||||||
if @posts.present?
|
if @posts
|
||||||
if (added_fields = User.whitelisted_user_custom_fields(@guardian)).present?
|
if (added_fields = User.whitelisted_user_custom_fields(@guardian)).present?
|
||||||
@user_custom_fields = User.custom_fields_for_ids(@posts.pluck(:user_id), added_fields)
|
@user_custom_fields = User.custom_fields_for_ids(@posts.pluck(:user_id), added_fields)
|
||||||
end
|
end
|
||||||
@ -388,7 +388,7 @@ class TopicView
|
|||||||
|
|
||||||
max = [max, post_count].min
|
max = [max, post_count].min
|
||||||
|
|
||||||
return @posts = [] if min > max
|
return @posts = Post.none if min > max
|
||||||
|
|
||||||
min = [[min, max].min, 0].max
|
min = [[min, max].min, 0].max
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user