Fast short-circuit for diffs between identical strings
authorAndrew Garrett <werdna@users.mediawiki.org>
Thu, 26 Mar 2009 13:29:38 +0000 (13:29 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Thu, 26 Mar 2009 13:29:38 +0000 (13:29 +0000)
includes/GlobalFunctions.php

index 0807f0b..9afb3ad 100644 (file)
@@ -1393,6 +1393,10 @@ function wfMerge( $old, $mine, $yours, &$result ){
  * @return string Unified diff of $before and $after
  */
 function wfDiff( $before, $after, $params = '-u' ) {
+       if ($before == $after) {
+               return '';
+       }
+       
        global $wgDiff;
 
        # This check may also protect against code injection in