Issue #1857956 by catch, David_Rothstein: Do not re-prepare comment update timestamp if it's the same as the created timestamp (performance improvement).
parent
286deb81ec
commit
3d169b3bb6
|
@ -2288,8 +2288,16 @@ function template_preprocess_comment(&$variables) {
|
||||||
$variables['comment'] = $comment;
|
$variables['comment'] = $comment;
|
||||||
$variables['node'] = $node;
|
$variables['node'] = $node;
|
||||||
$variables['author'] = theme('username', array('account' => $comment));
|
$variables['author'] = theme('username', array('account' => $comment));
|
||||||
|
|
||||||
$variables['created'] = format_date($comment->created);
|
$variables['created'] = format_date($comment->created);
|
||||||
|
|
||||||
|
// Avoid calling format_date() twice on the same timestamp.
|
||||||
|
if ($comment->changed == $comment->created) {
|
||||||
|
$variables['changed'] = $variables['created'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
$variables['changed'] = format_date($comment->changed);
|
$variables['changed'] = format_date($comment->changed);
|
||||||
|
}
|
||||||
|
|
||||||
$variables['new'] = !empty($comment->new) ? t('new') : '';
|
$variables['new'] = !empty($comment->new) ? t('new') : '';
|
||||||
$variables['picture'] = theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', array('account' => $comment)) : '';
|
$variables['picture'] = theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', array('account' => $comment)) : '';
|
||||||
|
|
Loading…
Reference in New Issue