Only query last comment info, when there is one

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/9272/head
Joas Schilling 8 years ago
parent 3ff041f86d
commit 446efa4625
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
  1. 4
      lib/private/Comments/Manager.php

@ -407,11 +407,11 @@ class Manager implements ICommentsManager {
$query->setMaxResults($limit);
}
$lastKnownComment = $this->getLastKnownComment(
$lastKnownComment = $lastKnownCommentId > 0 ? $this->getLastKnownComment(
$objectType,
$objectId,
$lastKnownCommentId
);
) : null;
if ($lastKnownComment instanceof IComment) {
$lastKnownCommentDateTime = $lastKnownComment->getCreationDateTime();
if ($sortDirection === 'desc') {

Loading…
Cancel
Save