Avoid pointless getNativeData() call in isCountable()
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 21 May 2015 06:56:25 +0000 (23:56 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 21 May 2015 06:56:25 +0000 (23:56 -0700)
Change-Id: I40ed1972a8815de645d11217b35c1060d5007e5a

includes/content/WikitextContent.php

index dbe09f9..3b449b6 100644 (file)
@@ -273,12 +273,11 @@ class WikitextContent extends TextContent {
                        return false;
                }
 
-               $text = $this->getNativeData();
-
                switch ( $wgArticleCountMethod ) {
                        case 'any':
                                return true;
                        case 'comma':
+                               $text = $this->getNativeData();
                                return strpos( $text, ',' ) !== false;
                        case 'link':
                                if ( $hasLinks === null ) { # not known, find out