r70420 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70419‎ | r70420 | r70421 >
Date:20:50, 3 August 2010
Author:simetrical
Status:ok
Tags:
Comment:
Clean up code now that the old path is gone
Modified paths:
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/CategoryPage.php
@@ -247,18 +247,6 @@
248248
249249 $dbr = wfGetDB( DB_SLAVE, 'category' );
250250
251 - $tables = array( 'page', 'categorylinks', 'category' );
252 - $fields = array( 'page_title', 'page_namespace', 'page_len',
253 - 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title',
254 - 'cat_subcats', 'cat_pages', 'cat_files' );
255 - $conds = array( 'cl_to' => $this->title->getDBkey() );
256 - $opts = array(
257 - 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey' ),
258 - 'LIMIT' => $this->limit + 1,
259 - );
260 - $joins = array( 'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ),
261 - 'category' => array( 'LEFT JOIN', 'cat_title = page_title AND page_namespace = ' . NS_CATEGORY ) );
262 -
263251 $this->nextPage = array(
264252 'page' => null,
265253 'subcat' => null,
@@ -281,12 +269,21 @@
282270 }
283271
284272 $res = $dbr->select(
285 - $tables,
286 - array_merge( $fields, array( 'cl_sortkey_prefix' ) ),
287 - $conds + $extraConds,
 273+ array( 'page', 'categorylinks', 'category' ),
 274+ array( 'page_title', 'page_namespace', 'page_len',
 275+ 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title',
 276+ 'cat_subcats', 'cat_pages', 'cat_files', 'cl_sortkey_prefix' ),
 277+ array( 'cl_to' => $this->title->getDBkey() ) + $extraConds,
288278 __METHOD__,
289 - $opts + array( 'ORDER BY' => $this->flip[$type] ? 'cl_sortkey DESC' : 'cl_sortkey' ),
290 - $joins
 279+ array(
 280+ 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey' ),
 281+ 'LIMIT' => $this->limit + 1,
 282+ 'ORDER BY' => $this->flip[$type] ? 'cl_sortkey DESC' : 'cl_sortkey',
 283+ ),
 284+ array(
 285+ 'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ),
 286+ 'category' => array( 'LEFT JOIN', 'cat_title = page_title AND page_namespace = ' . NS_CATEGORY )
 287+ )
291288 );
292289
293290 $count = 0;

Status & tagging log