FU r101629, made Pager only call doBatchLookups() if there are rows

This commit is contained in:
Aaron Schulz 2011-11-02 17:33:00 +00:00
parent 385809fee2
commit c8575ffd7a
2 changed files with 8 additions and 10 deletions

View file

@ -329,9 +329,12 @@ abstract class IndexPager extends ContextSource implements Pager {
if ( !$this->mQueryDone ) {
$this->doQuery();
}
# Do any special query batches before display
$this->doBatchLookups();
if ( $this->mResult->numRows() ) {
# Do any special query batches before display
$this->doBatchLookups();
}
# Don't use any extra rows returned by the query
$numRows = min( $this->mResult->numRows(), $this->mLimit );
@ -389,8 +392,8 @@ abstract class IndexPager extends ContextSource implements Pager {
/**
* Called from getBody(), before getStartBody() is called and
* after doQuery() was called. This will be called even if there
* are no rows in the result set.
* after doQuery() was called. This will be called only if there
* are rows in the result set.
*
* @return void
*/

View file

@ -385,11 +385,6 @@ class HistoryPager extends ReverseChronologicalPager {
}
function doBatchLookups() {
# No results? Nothing to batch
if ( !$this->mResult->numRows() ) {
return;
}
# Do a link batch query
$this->mResult->seek( 0 );
$batch = new LinkBatch();