Fast short-circuit for diffs between identical strings
[lhc/web/wiklou.git] / 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