http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72226

Revision: 72226
Author:   reedy
Date:     2010-09-02 20:48:02 +0000 (Thu, 02 Sep 2010)

Log Message:
-----------
Simplify some returns, remove some whitespace

Indent on a switch

Modified Paths:
--------------
    trunk/phase3/includes/Title.php

Modified: trunk/phase3/includes/Title.php
===================================================================
--- trunk/phase3/includes/Title.php     2010-09-02 20:43:07 UTC (rev 72225)
+++ trunk/phase3/includes/Title.php     2010-09-02 20:48:02 UTC (rev 72226)
@@ -3569,14 +3569,13 @@
                         . " ORDER BY cl_sortkey";
 
                $res = $dbr->query( $sql );
+               $data = array();
 
                if ( $dbr->numRows( $res ) > 0 ) {
                        foreach ( $res as $row ) {
                                // $data[] = 
Title::newFromText($wgContLang->getNSText ( NS_CATEGORY ).':'.$row->cl_to);
                                $data[$wgContLang->getNSText( NS_CATEGORY ) . 
':' . $row->cl_to] = $this->getFullText();
                        }
-               } else {
-                       $data = array();
                }
                return $data;
        }
@@ -3603,10 +3602,9 @@
                                        }
                                }
                        }
-                       return $stack;
-               } else {
-                       return array();
                }
+
+               return $stack;
        }
 
 
@@ -3801,21 +3799,21 @@
                        return true;  // any interwiki link might be viewable, 
for all we know
                }
                switch( $this->mNamespace ) {
-               case NS_MEDIA:
-               case NS_FILE:
-                       return (bool)wfFindFile( $this );  // file exists, 
possibly in a foreign repo
-               case NS_SPECIAL:
-                       return SpecialPage::exists( $this->getDBkey() );  // 
valid special page
-               case NS_MAIN:
-                       return $this->mDbkeyform == '';  // selflink, possibly 
with fragment
-               case NS_MEDIAWIKI:
-                       // If the page is form Mediawiki:message/lang, calling 
wfMsgWeirdKey causes
-                       // the full l10n of that language to be loaded. That 
takes much memory and
-                       // isn't needed. So we strip the language part away.
-                       list( $basename, /* rest */ ) = explode( '/', 
$this->mDbkeyform, 2 );
-                       return (bool)wfMsgWeirdKey( $basename );  // known 
system message
-               default:
-                       return false;
+                       case NS_MEDIA:
+                       case NS_FILE:
+                               return (bool)wfFindFile( $this );  // file 
exists, possibly in a foreign repo
+                       case NS_SPECIAL:
+                               return SpecialPage::exists( $this->getDBkey() 
);  // valid special page
+                       case NS_MAIN:
+                               return $this->mDbkeyform == '';  // selflink, 
possibly with fragment
+                       case NS_MEDIAWIKI:
+                               // If the page is form Mediawiki:message/lang, 
calling wfMsgWeirdKey causes
+                               // the full l10n of that language to be loaded. 
That takes much memory and
+                               // isn't needed. So we strip the language part 
away.
+                               list( $basename, /* rest */ ) = explode( '/', 
$this->mDbkeyform, 2 );
+                               return (bool)wfMsgWeirdKey( $basename );  // 
known system message
+                       default:
+                               return false;
                }
        }
 
@@ -4080,7 +4078,6 @@
                        __METHOD__
                );
 
-
                foreach ( $res as $row ) {
                        $redirs[] = self::newFromRow( $row );
                }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to