r52690 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52689‎ | r52690 | r52691 >
Date:12:59, 2 July 2009
Author:vasilievvv
Status:resolved (Comments)
Tags:
Comment:
Replace || with |, so messages get merged regardless of $used value
Modified paths:
  • /trunk/phase3/includes/LocalisationCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LocalisationCache.php
@@ -500,7 +500,7 @@
501501 $data = $this->readPHPFile( $fileName, 'extension' );
502502 $used = false;
503503 foreach ( $data as $key => $item ) {
504 - $used = $used ||
 504+ $used = $used |
505505 $this->mergeExtensionItem( $codeSequence, $key, $allData[$key], $item );
506506 }
507507 if ( $used ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r55507Change r52690 per suggestions on CodeReview: rearrange from boolean OR myster...brion21:53, 22 August 2009

Comments

#Comment by Simetrical (talk | contribs)   02:57, 3 July 2009

Um, what? $used is a boolean, using bitwise or on it is really weird. If you don't want short-circuiting, why don't you just switch the order of the operands? Or better yet, do

if ( $this->mergeExtensionItem( $codeSequence, $key, $allData[$key], $item ) ) {
	$used = true;
}

which I find a lot more comprehensible anyway.

#Comment by Brion VIBBER (talk | contribs)   21:54, 22 August 2009

Done in r55507

Status & tagging log