From: Antoine Musso Date: Sat, 16 Dec 2006 21:32:11 +0000 (+0000) Subject: Save two function calls when pages are not cached. X-Git-Tag: 1.31.0-rc.0~54878 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=4cc7d42d465910bb6f77b35f9f19ea971f64edf5;p=lhc%2Fweb%2Fwiklou.git Save two function calls when pages are not cached. --- 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