* Removed Parser::doExponent(), unused
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Tue, 29 Nov 2005 09:55:50 +0000 (09:55 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Tue, 29 Nov 2005 09:55:50 +0000 (09:55 +0000)
* substr( '======', 0, $i ) => str_repeat( '=', $i ), clearer and slightly faster

includes/Parser.php

index f40d3ea..8747b09 100644 (file)
@@ -831,19 +831,6 @@ class Parser
                return $text;
        }
 
-       /**
-        * Parse ^^ tokens and return html
-        *
-        * @access private
-        */
-       function doExponent( $text ) {
-               $fname = 'Parser::doExponent';
-               wfProfileIn( $fname );
-               $text = preg_replace('/\^\^(.*?)\^\^/','<small><sup>\\1</sup></small>', $text);
-               wfProfileOut( $fname );
-               return $text;
-       }
-
        /**
         * Parse headers and return html
         *
@@ -853,7 +840,7 @@ class Parser
                $fname = 'Parser::doHeadings';
                wfProfileIn( $fname );
                for ( $i = 6; $i >= 1; --$i ) {
-                       $h = substr( '======', 0, $i );
+                       $h = str_repeat( '=', $i );
                        $text = preg_replace( "/^{$h}(.+){$h}(\\s|$)/m",
                          "<h{$i}>\\1</h{$i}>\\2", $text );
                }