Skip to content

Commit dad66d7

Browse files
committed
fix: The -f option interfered with the -r when used at the same time.
optimization: The regex comparitions didn't stop at the first match but did all of them regardless.
1 parent 32d2140 commit dad66d7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/diff_hypermail_archives.pl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ sub filter_filenames {
122122
if ($filename =~ m/$regex/) {
123123
$res = 1;
124124
print "$filename is ignored per regex: " . $regex . "\n" if $debug && !$quiet;
125+
last;
125126
}
126127
}
127128

@@ -139,6 +140,7 @@ sub filter_regex {
139140
if ($text1 =~ m/$regex/ && $text2 =~ m/$regex/) {
140141
$res = 1;
141142
print "$text1 is ignored per regex: " . $regex . "\n" if $debug && !$quiet;
143+
last;
142144
}
143145
}
144146

@@ -251,11 +253,10 @@ sub diff_files_complete {
251253
|| (defined $ln_1_1 && !defined $ln_1_2
252254
&& defined $ln_2_1 && !defined $ln_2_2)) {
253255

254-
if ($ignore_footer) {
255-
if ($ln_1_1 >= $footer_line) {
256-
$skip = 1;
257-
last;
258-
}
256+
if ($ignore_footer
257+
&& ($ln_1_1 >= $footer_line)) {
258+
$skip = 1;
259+
last;
259260

260261
} elsif ((!defined $ln_1_2
261262
&& $$generated_by_lines{$ln_1_1})

0 commit comments

Comments
 (0)