Make WordPress Core


Ignore:
Timestamp:
12/13/2011 11:45:31 PM (12 years ago)
Author:
ryan
Message:

Use one space, not two, after trailing punctuation. fixes #19537

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-diff.php

    r17781 r19593  
    203203
    204204        // Does the aforementioned additional processing
    205         // *_matches tell what rows are "the same" in orig and final.  Those pairs will be diffed to get word changes
     205        // *_matches tell what rows are "the same" in orig and final. Those pairs will be diffed to get word changes
    206206        //  match is numeric: an index in other column
    207         //  match is 'X': no match.  It is a new row
     207        //  match is 'X': no match. It is a new row
    208208        // *_rows are column vectors for the orig column and the final column.
    209209        //  row >= 0: an indix of the $orig or $final array
     
    232232                    $diff_ratio = $stripped_matches / $stripped_diff;
    233233                    if ( $diff_ratio > $this->_diff_threshold )
    234                         continue; // Too different.  Don't save diffs.
     234                        continue; // Too different. Don't save diffs.
    235235                }
    236236
     
    242242
    243243        foreach ( array_keys($orig_rows) as $row ) {
    244             // Both columns have blanks.  Ignore them.
     244            // Both columns have blanks. Ignore them.
    245245            if ( $orig_rows[$row] < 0 && $final_rows[$row] < 0 )
    246246                continue;
    247247
    248             // If we have a word based diff, use it.  Otherwise, use the normal line.
     248            // If we have a word based diff, use it. Otherwise, use the normal line.
    249249            if ( isset( $orig_diffs[$orig_rows[$row]] ) )
    250250                $orig_line = $orig_diffs[$orig_rows[$row]];
     
    261261                $final_line = '';
    262262
    263             if ( $orig_rows[$row] < 0 ) { // Orig is blank.  This is really an added row.
     263            if ( $orig_rows[$row] < 0 ) { // Orig is blank. This is really an added row.
    264264                $r .= $this->_added( array($final_line), false );
    265             } elseif ( $final_rows[$row] < 0 ) { // Final is blank.  This is really a deleted row.
     265            } elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row.
    266266                $r .= $this->_deleted( array($orig_line), false );
    267267            } else { // A true changed row.
     
    289289    function interleave_changed_lines( $orig, $final ) {
    290290
    291         // Contains all pairwise string comparisons.  Keys are such that this need only be a one dimensional array.
     291        // Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array.
    292292        $matches = array();
    293293        foreach ( array_keys($orig) as $o ) {
     
    310310                continue;
    311311
    312             // First match for these guys.  Must be best match
     312            // First match for these guys. Must be best match
    313313            if ( !isset($orig_matches[$o]) && !isset($final_matches[$f]) ) {
    314314                $orig_matches[$o] = $f;
     
    343343            if ( false === $final_pos ) { // This orig is paired with a blank final.
    344344                array_splice( $final_rows, $orig_pos, 0, -1 );
    345             } elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways.  Pad final with blank rows.
     345            } elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows.
    346346                $diff_pos = $final_pos - $orig_pos;
    347347                while ( $diff_pos < 0 )
    348348                    array_splice( $final_rows, $orig_pos, 0, $diff_pos++ );
    349             } elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways.  Pad orig with blank rows.
     349            } elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows.
    350350                $diff_pos = $orig_pos - $final_pos;
    351351                while ( $diff_pos < 0 )
     
    428428        $difference = array_sum( array_map( array(&$this, 'difference'), $chars1, $chars2 ) );
    429429
    430         // $string1 has zero length? Odd.  Give huge penalty by not dividing.
     430        // $string1 has zero length? Odd. Give huge penalty by not dividing.
    431431        if ( !$string1 )
    432432            return $difference;
Note: See TracChangeset for help on using the changeset viewer.