@@ -816,9 +816,6 @@ private function log_bits( $search_regex, $old_data, $old_matches, $new ) {
816
816
$ append_next = false ;
817
817
$ last_old_offset = $ last_new_offset = 0 ;
818
818
for ( $ i = 0 ; $ i < $ match_cnt ; $ i ++ ) {
819
- if ( empty ( $ old_matches [0 ][ $ i ] ) || empty ( $ new_matches [0 ][ $ i ] ) ) {
820
- continue ;
821
- }
822
819
$ old_match = $ old_matches [0 ][ $ i ][0 ];
823
820
$ old_offset = $ old_matches [0 ][ $ i ][1 ];
824
821
$ new_match = $ new_matches [0 ][ $ i ][0 ];
@@ -842,12 +839,10 @@ private function log_bits( $search_regex, $old_data, $old_matches, $new ) {
842
839
$ new_after = \cli \safe_substr ( substr ( $ new_data , $ new_end_offset ), 0 , $ this ->log_after_context , false /*is_width*/ , $ encoding );
843
840
// To lessen context duplication in output, shorten the after context if it overlaps with the next match.
844
841
if ( $ i + 1 < $ match_cnt && $ old_end_offset + strlen ( $ old_after ) > $ old_matches [0 ][ $ i + 1 ][1 ] ) {
845
- if ( ! empty ( $ old_matches [0 ][ $ i + 1 ] ) && ! empty ( $ new_matches [0 ][ $ i + 1 ] ) ) {
846
- $ old_after = substr ( $ old_after , 0 , $ old_matches [0 ][ $ i + 1 ][1 ] - $ old_end_offset );
847
- $ new_after = substr ( $ new_after , 0 , $ new_matches [0 ][ $ i + 1 ][1 ] - $ new_end_offset );
848
- $ after_shortened = true ;
849
- // On the next iteration, will append with no before context.
850
- }
842
+ $ old_after = substr ( $ old_after , 0 , $ old_matches [0 ][ $ i + 1 ][1 ] - $ old_end_offset );
843
+ $ new_after = substr ( $ new_after , 0 , $ new_matches [0 ][ $ i + 1 ][1 ] - $ new_end_offset );
844
+ $ after_shortened = true ;
845
+ // On the next iteration, will append with no before context.
851
846
}
852
847
}
853
848
0 commit comments