for ( $yi = $skip; $yi < $n_to - $endskip; $yi++ ) {
$line = $to_lines[$yi];
- if ( ( $this->ychanged[$yi] = empty( $xhash[$this->lineHash( $line )] ) ) ) {
+ $this->ychanged[$yi] = empty( $xhash[$this->lineHash( $line )] );
+ if ( $this->ychanged[$yi] ) {
continue;
}
$yhash[$this->lineHash( $line )] = 1;
}
for ( $xi = $skip; $xi < $n_from - $endskip; $xi++ ) {
$line = $from_lines[$xi];
- if ( ( $this->xchanged[$xi] = empty( $yhash[$this->lineHash( $line )] ) ) ) {
+ $this->xchanged[$xi] = empty( $yhash[$this->lineHash( $line )] );
+ if ( $this->xchanged[$xi] ) {
continue;
}
$this->xv[] = $line;
# Notice that WordLevelDiff returns HTML-escaped output.
# Hence, we will be calling addedLine/deletedLine without HTML-escaping.
- while ( $line = array_shift( $del ) ) {
+ $line = array_shift( $del );
+ while ( $line ) {
$aline = array_shift( $add );
echo '<tr>' . $this->deletedLine( $line ) .
$this->addedLine( $aline ) . "</tr>\n";
+ $line = array_shift( $del );
}
foreach ( $add as $line ) { # If any leftovers
echo '<tr>' . $this->emptyLine() .
$shape->addAttribute( 'points', self::shapePointsToString( $drawSpec['shape'] ) );
}
- if ( !$fh = fopen( $filename, 'w' ) ) {
+ $fh = fopen( $filename, 'w' );
+ if ( !$fh ) {
throw new Exception( "couldn't open $filename for writing" );
}
fwrite( $fh, $svg->asXML() );