Avoid extra parent id query on rev creation; only needs to be done if the current...
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 15 Jan 2009 17:48:14 +0000 (17:48 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 15 Jan 2009 17:48:14 +0000 (17:48 +0000)
includes/Revision.php

index 37c2260..5fef68c 100644 (file)
@@ -819,7 +819,8 @@ class Revision {
                                'rev_timestamp'  => $dbw->timestamp( $this->mTimestamp ),
                                'rev_deleted'    => $this->mDeleted,
                                'rev_len'            => $this->mSize,
-                               'rev_parent_id'  => $this->mParentId ? $this->mParentId : $this->getPreviousRevisionId( $dbw )
+                               'rev_parent_id'  => is_null($this->mParentId) ?
+                                       $this->getPreviousRevisionId( $dbw ) : $this->mParentId
                        ), __METHOD__
                );