r81256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81255‎ | r81256 | r81257 >
Date:16:41, 31 January 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Swap "or" to ||
Modified paths:
  • /trunk/phase3/includes/SiteStats.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SiteStats.php
@@ -163,8 +163,8 @@
164164 private static function isSane( $row ) {
165165 if(
166166 $row === false
167 - or $row->ss_total_pages < $row->ss_good_articles
168 - or $row->ss_total_edits < $row->ss_total_pages
 167+ || $row->ss_total_pages < $row->ss_good_articles
 168+ || $row->ss_total_edits < $row->ss_total_pages
169169 ) {
170170 return false;
171171 }
@@ -173,7 +173,7 @@
174174 'total_pages', 'users', 'admins', 'images' ) as $member ) {
175175 if(
176176 $row->{"ss_$member"} > 2000000000
177 - or $row->{"ss_$member"} < 0
 177+ || $row->{"ss_$member"} < 0
178178 ) {
179179 return false;
180180 }

Comments

#Comment by Hashar (talk | contribs)   09:22, 1 February 2011

seems good since both logical methods (or ||) have a lower precedence than comparison operators (<)

Status & tagging log