* 0 => NS_MAIN
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Wed, 21 Dec 2005 02:35:20 +0000 (02:35 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Wed, 21 Dec 2005 02:35:20 +0000 (02:35 +0000)
* Simplified Namespace::isMovable()

includes/Namespace.php

index f1341cc..15fc36e 100644 (file)
@@ -56,10 +56,7 @@ class Namespace {
         * @return bool
         */
        function isMovable( $index ) {
-               if ( $index < NS_MAIN || $index == NS_IMAGE  || $index == NS_CATEGORY ) {
-                       return false;
-               }
-               return true;
+               return !( $index < NS_MAIN || $index == NS_IMAGE  || $index == NS_CATEGORY );
        }
 
        /**
@@ -75,7 +72,7 @@ class Namespace {
         * @return bool
         */
        function isTalk( $index ) {
-               return ($index > 0)  // Special namespaces are negative
+               return ($index > NS_MAIN)  // Special namespaces are negative
                        && ($index % 2); // Talk namespaces are odd-numbered
        }