r62239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62238‎ | r62239 | r62240 >
Date:11:47, 10 February 2010
Author:demon
Status:ok
Tags:
Comment:
Cleanup r61844: Don't need tableName(), use buildLike(), use array_merge() not +=
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -161,14 +161,14 @@
162162 }
163163
164164 function getRevCountQuery( $dbr ) {
165 - $tables = array( $dbr->tableName( 'code_rev' ) );
 165+ $tables = array( 'code_rev' );
166166 $selectFields = array( 'COUNT( DISTINCT cr_id ) AS rev_count' );
167167 // count if code_rev where path matches
168168 if ( $this->mPath ) {
169 - $tables[] = $dbr->tableName( 'code_paths' );
 169+ $tables[] = 'code_paths';
170170 $whereCond = array('cr_repo_id' => $this->mRepo->getId(),
171171 'cr_id = cp_rev_id',
172 - ' cp_path LIKE ' . $dbr->addQuotes( $this->mPath . '%' ),
 172+ ' cp_path' . $dbr->buildLike( $this->mPath, $dbr->anyString() ),
173173 // performance
174174 ' cp_rev_id > ' . ( $this->mRepo->getLastStoredRev() - 20000 )
175175 );
@@ -176,7 +176,7 @@
177177 } else {
178178 $whereCond = array('cr_repo_id' => $this->mRepo->getId());
179179 }
180 - $whereCond += $this->getSpecializedWhereClause( $dbr );
 180+ $whereCond = array_merge( $whereCond, $this->getSpecializedWhereClause( $dbr ) );
181181 return $dbr->selectRow( $tables, $selectFields, $whereCond );
182182 }
183183

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61844replaced subselect with a select distinctpdhanda01:35, 2 February 2010

Status & tagging log