r45776 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45775‎ | r45776 | r45777 >
Date:17:48, 15 January 2009
Author:aaron
Status:ok
Tags:
Comment:
Avoid extra parent id query on rev creation; only needs to be done if the current value is null, not 0
Modified paths:
  • /trunk/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Revision.php
@@ -819,7 +819,8 @@
820820 'rev_timestamp' => $dbw->timestamp( $this->mTimestamp ),
821821 'rev_deleted' => $this->mDeleted,
822822 'rev_len' => $this->mSize,
823 - 'rev_parent_id' => $this->mParentId ? $this->mParentId : $this->getPreviousRevisionId( $dbw )
 823+ 'rev_parent_id' => is_null($this->mParentId) ?
 824+ $this->getPreviousRevisionId( $dbw ) : $this->mParentId
824825 ), __METHOD__
825826 );
826827

Status & tagging log