Merge "Avoid certain useless dbperformance log entries"
[lhc/web/wiklou.git] / includes / diff / DairikiDiff.php
index 0e38d68..d327433 100644 (file)
@@ -189,7 +189,7 @@ class DiffOpChange extends DiffOp {
  * More ideas are taken from:
  *     http://www.ics.uci.edu/~eppstein/161/960229.html
  *
- * Some ideas are (and a bit of code) are from from analyze.c, from GNU
+ * Some ideas (and a bit of code) are from analyze.c, from GNU
  * diffutils-2.7, which can be found at:
  *     ftp://gnudist.gnu.org/pub/gnu/diffutils/diffutils-2.7.tar.gz
  *
@@ -222,7 +222,6 @@ class DiffEngine {
         * @return DiffOp[]
         */
        public function diff( $from_lines, $to_lines ) {
-               wfProfileIn( __METHOD__ );
 
                // Diff and store locally
                $this->diffLocal( $from_lines, $to_lines );
@@ -272,7 +271,6 @@ class DiffEngine {
                                $edits[] = new DiffOpAdd( $add );
                        }
                }
-               wfProfileOut( __METHOD__ );
 
                return $edits;
        }
@@ -283,7 +281,6 @@ class DiffEngine {
         */
        private function diffLocal( $from_lines, $to_lines ) {
                global $wgExternalDiffEngine;
-               wfProfileIn( __METHOD__ );
 
                if ( $wgExternalDiffEngine == 'wikidiff3' ) {
                        // wikidiff3
@@ -346,7 +343,6 @@ class DiffEngine {
                        // Find the LCS.
                        $this->compareSeq( 0, count( $this->xv ), 0, count( $this->yv ) );
                }
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -424,7 +420,9 @@ class DiffEngine {
                        }
 
                        $x1 = $xoff + (int)( ( $numer + ( $xlim - $xoff ) * $chunk ) / $nchunks );
+                       // @codingStandardsIgnoreFile Ignore Squiz.WhiteSpace.SemicolonSpacing.Incorrect
                        for ( ; $x < $x1; $x++ ) {
+                               // @codingStandardsIgnoreEnd
                                $line = $flip ? $this->yv[$x] : $this->xv[$x];
                                if ( empty( $ymatches[$line] ) ) {
                                        continue;
@@ -580,7 +578,6 @@ class DiffEngine {
         * This is extracted verbatim from analyze.c (GNU diffutils-2.7).
         */
        private function shiftBoundaries( $lines, &$changed, $other_changed ) {
-               wfProfileIn( __METHOD__ );
                $i = 0;
                $j = 0;
 
@@ -695,7 +692,6 @@ class DiffEngine {
                                assert( '$j >= 0 && !$other_changed[$j]' );
                        }
                }
-               wfProfileOut( __METHOD__ );
        }
 }
 
@@ -856,7 +852,6 @@ class MappedDiff extends Diff {
         */
        public function __construct( $from_lines, $to_lines,
                $mapped_from_lines, $mapped_to_lines ) {
-               wfProfileIn( __METHOD__ );
 
                assert( 'count( $from_lines ) == count( $mapped_from_lines )' );
                assert( 'count( $to_lines ) == count( $mapped_to_lines )' );
@@ -878,7 +873,6 @@ class MappedDiff extends Diff {
                                $yi += count( $closing );
                        }
                }
-               wfProfileOut( __METHOD__ );
        }
 }
 
@@ -979,14 +973,12 @@ class WordLevelDiff extends MappedDiff {
         * @param string[] $closing_lines
         */
        public function __construct( $orig_lines, $closing_lines ) {
-               wfProfileIn( __METHOD__ );
 
                list( $orig_words, $orig_stripped ) = $this->split( $orig_lines );
                list( $closing_words, $closing_stripped ) = $this->split( $closing_lines );
 
                parent::__construct( $orig_words, $closing_words,
                        $orig_stripped, $closing_stripped );
-               wfProfileOut( __METHOD__ );
        }
 
        /**
@@ -995,7 +987,6 @@ class WordLevelDiff extends MappedDiff {
         * @return array[]
         */
        private function split( $lines ) {
-               wfProfileIn( __METHOD__ );
 
                $words = array();
                $stripped = array();
@@ -1026,7 +1017,6 @@ class WordLevelDiff extends MappedDiff {
                                }
                        }
                }
-               wfProfileOut( __METHOD__ );
 
                return array( $words, $stripped );
        }
@@ -1035,7 +1025,6 @@ class WordLevelDiff extends MappedDiff {
         * @return string[]
         */
        public function orig() {
-               wfProfileIn( __METHOD__ );
                $orig = new HWLDFWordAccumulator;
 
                foreach ( $this->edits as $edit ) {
@@ -1046,7 +1035,6 @@ class WordLevelDiff extends MappedDiff {
                        }
                }
                $lines = $orig->getLines();
-               wfProfileOut( __METHOD__ );
 
                return $lines;
        }
@@ -1055,7 +1043,6 @@ class WordLevelDiff extends MappedDiff {
         * @return string[]
         */
        public function closing() {
-               wfProfileIn( __METHOD__ );
                $closing = new HWLDFWordAccumulator;
 
                foreach ( $this->edits as $edit ) {
@@ -1066,7 +1053,6 @@ class WordLevelDiff extends MappedDiff {
                        }
                }
                $lines = $closing->getLines();
-               wfProfileOut( __METHOD__ );
 
                return $lines;
        }