From 57073ee3b102a200ae015fa6e211c846f6014026 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 8 Dec 2008 22:30:58 +0000 Subject: [PATCH] Make pageCond() use PK is ID is already cached --- includes/Title.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index da5ac50359..792f475901 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2978,7 +2978,11 @@ class Title { * @return \type{\array} Selection array */ public function pageCond() { - return array( 'page_namespace' => $this->mNamespace, 'page_title' => $this->mDbkeyform ); + if( $this->mArticleID > 0 ) { + return array( 'page_id' => $this->mArticleID ); // PK avoids secondary lookups + } else { + return array( 'page_namespace' => $this->mNamespace, 'page_title' => $this->mDbkeyform ); + } } /** -- 2.20.1