Skip to content

Commit 77adaac

Browse files
author
alpipego
committed
use preg_replace count
1 parent abc8f4c commit 77adaac

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Search_Replace_Command.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,12 +810,11 @@ private function log_bits( $search_regex, $old_data, $old_matches, $new ) {
810810
$diff += strlen( $new ) - strlen( $old_matches[0][ $i ][0] );
811811
$i++;
812812
return $new;
813-
}, $old_data, $this->regex_limit );
813+
}, $old_data, $this->regex_limit, $match_cnt );
814814

815815
$old_bits = $new_bits = array();
816816
$append_next = false;
817817
$last_old_offset = $last_new_offset = 0;
818-
$match_cnt = count( $old_matches[0] );
819818
for ( $i = 0; $i < $match_cnt; $i++ ) {
820819
if ( empty( $old_matches[0][ $i ] ) || empty( $new_matches[0][ $i ] ) ) {
821820
continue;

0 commit comments

Comments
 (0)