From de2d73876a296fa55dcadd785a8b3aa9e49aeda0 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 15 Jan 2009 17:48:14 +0000 Subject: [PATCH] Avoid extra parent id query on rev creation; only needs to be done if the current value is null, not 0 --- includes/Revision.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Revision.php b/includes/Revision.php index 37c22607b0..5fef68c296 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -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__ ); -- 2.20.1