From 7f9fbfe940e924d243463083e6a819ccf575bd80 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 6 Jan 2008 02:50:18 +0000 Subject: [PATCH] Don't compare text twice --- includes/Article.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 9a7e85bd6d..575f48fb7e 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 { -- 2.20.1