* 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
*
* @return DiffOp[]
*/
public function diff( $from_lines, $to_lines ) {
- wfProfileIn( __METHOD__ );
// Diff and store locally
$this->diffLocal( $from_lines, $to_lines );
$edits[] = new DiffOpAdd( $add );
}
}
- wfProfileOut( __METHOD__ );
return $edits;
}
*/
private function diffLocal( $from_lines, $to_lines ) {
global $wgExternalDiffEngine;
- wfProfileIn( __METHOD__ );
if ( $wgExternalDiffEngine == 'wikidiff3' ) {
// wikidiff3
// Find the LCS.
$this->compareSeq( 0, count( $this->xv ), 0, count( $this->yv ) );
}
- wfProfileOut( __METHOD__ );
}
/**
}
$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;
* This is extracted verbatim from analyze.c (GNU diffutils-2.7).
*/
private function shiftBoundaries( $lines, &$changed, $other_changed ) {
- wfProfileIn( __METHOD__ );
$i = 0;
$j = 0;
assert( '$j >= 0 && !$other_changed[$j]' );
}
}
- wfProfileOut( __METHOD__ );
}
}
*/
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 )' );
$yi += count( $closing );
}
}
- wfProfileOut( __METHOD__ );
}
}
* @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__ );
}
/**
* @return array[]
*/
private function split( $lines ) {
- wfProfileIn( __METHOD__ );
$words = array();
$stripped = array();
}
}
}
- wfProfileOut( __METHOD__ );
return array( $words, $stripped );
}
* @return string[]
*/
public function orig() {
- wfProfileIn( __METHOD__ );
$orig = new HWLDFWordAccumulator;
foreach ( $this->edits as $edit ) {
}
}
$lines = $orig->getLines();
- wfProfileOut( __METHOD__ );
return $lines;
}
* @return string[]
*/
public function closing() {
- wfProfileIn( __METHOD__ );
$closing = new HWLDFWordAccumulator;
foreach ( $this->edits as $edit ) {
}
}
$lines = $closing->getLines();
- wfProfileOut( __METHOD__ );
return $lines;
}