r76698 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76697‎ | r76698 | r76699 >
Date:19:47, 15 November 2010
Author:hashar
Status:ok
Tags:
Comment:
Get ride of $counter in functions calls. Follow up r65417.
Modified paths:
  • /trunk/phase3/includes/HistoryPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HistoryPage.php
@@ -354,7 +354,8 @@
355355 if( $this->lastRow ) {
356356 $latest = ($this->counter == 1 && $this->mIsFirst);
357357 $firstInList = $this->counter == 1;
358 - $s = $this->historyLine( $this->lastRow, $row, $this->counter++,
 358+ $this->counter++;
 359+ $s = $this->historyLine( $this->lastRow, $row,
359360 $this->title->getNotificationTimestamp(), $latest, $firstInList );
360361 } else {
361362 $s = '';
@@ -441,7 +442,8 @@
442443 # The next row is the past-the-end row
443444 $next = $this->mPastTheEndRow;
444445 }
445 - $s = $this->historyLine( $this->lastRow, $next, $this->counter++,
 446+ $this->counter++;
 447+ $s = $this->historyLine( $this->lastRow, $next,
446448 $this->title->getNotificationTimestamp(), $latest, $firstInList );
447449 } else {
448450 $s = '';
@@ -478,13 +480,12 @@
479481 *
480482 * @param $row Object: the database row corresponding to the previous line.
481483 * @param $next Mixed: the database row corresponding to the next line.
482 - * @param $counter Integer: apparently a counter of what row number we're at, counted from the top row = 1.
483484 * @param $notificationtimestamp
484485 * @param $latest Boolean: whether this row corresponds to the page's latest revision.
485486 * @param $firstInList Boolean: whether this row corresponds to the first displayed on this history page.
486487 * @return String: HTML output for the row
487488 */
488 - function historyLine( $row, $next, $counter = '', $notificationtimestamp = false,
 489+ function historyLine( $row, $next, $notificationtimestamp = false,
489490 $latest = false, $firstInList = false )
490491 {
491492 global $wgUser, $wgLang;
@@ -492,8 +493,8 @@
493494 $rev->setTitle( $this->title );
494495
495496 $curlink = $this->curLink( $rev, $latest );
496 - $lastlink = $this->lastLink( $rev, $next, $counter );
497 - $diffButtons = $this->diffButtons( $rev, $firstInList, $counter );
 497+ $lastlink = $this->lastLink( $rev, $next );
 498+ $diffButtons = $this->diffButtons( $rev, $firstInList );
498499 $histLinks = Html::rawElement(
499500 'span',
500501 array( 'class' => 'mw-history-histlinks' ),
@@ -659,10 +660,9 @@
660661 *
661662 * @param $prevRev Revision: the previous revision
662663 * @param $next Mixed: the newer revision
663 - * @param $counter Integer: what row on the history list this is
664664 * @return String
665665 */
666 - function lastLink( $prevRev, $next, $counter ) {
 666+ function lastLink( $prevRev, $next ) {
667667 $last = $this->historyPage->message['last'];
668668 # $next may either be a Row, null, or "unkown"
669669 $nextRev = is_object($next) ? new Revision( $next ) : $next;
@@ -704,10 +704,10 @@
705705 *
706706 * @param $rev Revision object
707707 * @param $firstInList Boolean: is this version the first one?
708 - * @param $counter Integer: a counter of what row number we're at, counted from the top row = 1.
 708+ *
709709 * @return String: HTML output for the radio buttons
710710 */
711 - function diffButtons( $rev, $firstInList, $counter ) {
 711+ function diffButtons( $rev, $firstInList ) {
712712 if( $this->getNumRows() > 1 ) {
713713 $id = $rev->getId();
714714 $radio = array( 'type' => 'radio', 'value' => $id );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65417Removed redundant check if diffButtons()aaron01:16, 22 April 2010

Status & tagging log