From 4cc7d42d465910bb6f77b35f9f19ea971f64edf5 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 16 Dec 2006 21:32:11 +0000 Subject: [PATCH] Save two function calls when pages are not cached. --- includes/QueryPage.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 850365c58b..e4f55516ea 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -282,13 +282,15 @@ class QueryPage { $sname = $this->getName(); $fname = get_class($this) . '::doQuery'; - $sql = $this->getSQL(); $dbr =& wfGetDB( DB_SLAVE ); - $querycache = $dbr->tableName( 'querycache' ); $wgOut->setSyndicated( $this->isSyndicated() ); - if ( $this->isCached() ) { + if ( !$this->isCached() ) { + $sql = $this->getSQL(); + } else { + # Get the cached result + $querycache = $dbr->tableName( 'querycache' ); $type = $dbr->strencode( $sname ); $sql = "SELECT qc_type as type, qc_namespace as namespace,qc_title as title, qc_value as value -- 2.20.1