Don't compare text twice
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 6 Jan 2008 02:50:18 +0000 (02:50 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 6 Jan 2008 02:50:18 +0000 (02:50 +0000)
includes/Article.php

index 9a7e85b..575f48f 100644 (file)
@@ -1349,8 +1349,10 @@ class Article {
 
                        $lastRevision = 0;
                        $revisionId = 0;
+                       
+                       $changed = ( strcmp( $text, $oldtext ) != 0 );
 
-                       if ( 0 != strcmp( $text, $oldtext ) ) {
+                       if ( $changed ) {
                                $this->mGoodAdjustment = (int)$this->isCountable( $text )
                                  - (int)$this->isCountable( $oldtext );
                                $this->mTotalAdjustment = 0;
@@ -1415,9 +1417,8 @@ class Article {
                                # Invalidate cache of this article and all pages using this article
                                # as a template. Partly deferred.
                                Article::onArticleEdit( $this->mTitle );
-
+                               
                                # Update links tables, site stats, etc.
-                               $changed = ( strcmp( $oldtext, $text ) != 0 );
                                $this->editUpdates( $text, $summary, $isminor, $now, $revisionId, $changed );
                        }
                } else {