r59751 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59750‎ | r59751 | r59752 >
Date:03:15, 5 December 2009
Author:tomasz
Status:ok
Tags:
Comment:
Bugfix where zero value in amount caused unnecessary division
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php
@@ -414,6 +414,7 @@
415415 // Merge null and USD
416416 $totals['USD'][1] += $totals[null][1];
417417 $totals['USD'][2] += $totals[null][2];
 418+ $totals['USD'][3] = ( $totals[null][3] == 0 ) ? $totals['USD'][3] : ( $totals['USD'][3] + $totals[null][3] ) / 2;
418419 $totals['USD'][3] = ( $totals['USD'][3] + $totals[null][3] ) / 2;
419420 $totals['USD'][4] = max( $totals['USD'][4], $totals[null][4] );
420421 /* $totals['USD'][5] = min( $totals['USD'][5], $totals[null][5] ); */

Follow-up revisions

RevisionCommit summaryAuthorDate
r59752Removing unnecessary line due to r59751tomasz03:16, 5 December 2009

Status & tagging log