PERF: Remove `Object#present?` check introduced in e0d5d9670a.

This commit is contained in:
Guo Xiang Tan 2017-09-07 21:35:16 +08:00
parent 7d350d0d75
commit 58321d0783
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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