r80339 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80338‎ | r80339 | r80340 >
Date:22:37, 14 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix indenting, rearrange some where statements
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryCategoryMembers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php
@@ -90,9 +90,9 @@
9191
9292 $this->addFieldsIf( 'cl_timestamp', $fld_timestamp || $params['sort'] == 'timestamp' );
9393 $this->addFieldsIf( 'cl_type', $fld_type );
 94+
9495 $this->addTables( array( 'page', 'categorylinks' ) ); // must be in this order for 'USE INDEX'
9596
96 - $this->addWhere( 'cl_from=page_id' );
9797 $this->setContinuation( $params['continue'], $params['dir'] );
9898 $this->addWhereFld( 'cl_to', $categoryTitle->getDBkey() );
9999
@@ -112,21 +112,23 @@
113113
114114 if ( $params['sort'] == 'timestamp' ) {
115115 $this->addWhereRange( 'cl_timestamp',
116 - $dir,
117 - $params['start'],
118 - $params['end'] );
 116+ $dir,
 117+ $params['start'],
 118+ $params['end'] );
119119
120120 $this->addOption( 'USE INDEX', 'cl_timestamp' );
121121 } else {
122122 $this->addWhereRange( 'cl_sortkey',
123 - $dir,
124 - $params['startsortkey'],
125 - $params['endsortkey'] );
 123+ $dir,
 124+ $params['startsortkey'],
 125+ $params['endsortkey'] );
126126
127127 $this->addWhereRange( 'cl_from', $dir, null, null );
128128 $this->addOption( 'USE INDEX', 'cl_sortkey' );
129129 }
130130
 131+ $this->addWhere( 'cl_from=page_id' );
 132+
131133 $limit = $params['limit'];
132134 $this->addOption( 'LIMIT', $limit + 1 );
133135

Follow-up revisions

RevisionCommit summaryAuthorDate
r807221.17: MFT r80324, r80326, r80328, r80339, r80350, r80351, r80355, r80358, r80...catrope23:00, 21 January 2011

Status & tagging log