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
|
||||
@posts =
|
||||
if @min_replies && @topic.posts_count < @min_replies + 1
|
||||
[]
|
||||
Post.none
|
||||
else
|
||||
filter_posts_liked_by_moderators
|
||||
setup_posts
|
||||
|
|
|
@ -66,7 +66,7 @@ class TopicView
|
|||
|
||||
filter_posts(options)
|
||||
|
||||
if @posts.present?
|
||||
if @posts
|
||||
if (added_fields = User.whitelisted_user_custom_fields(@guardian)).present?
|
||||
@user_custom_fields = User.custom_fields_for_ids(@posts.pluck(:user_id), added_fields)
|
||||
end
|
||||
|
@ -388,7 +388,7 @@ class TopicView
|
|||
|
||||
max = [max, post_count].min
|
||||
|
||||
return @posts = [] if min > max
|
||||
return @posts = Post.none if min > max
|
||||
|
||||
min = [[min, max].min, 0].max
|
||||
|
||||
|
|
Loading…
Reference in New Issue