From 8ca1a509de03f970c3787983d79a6cd724af151d Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Thu, 28 Nov 2024 09:46:19 -0600 Subject: [PATCH] Move vars closer to where they are used. --- ack | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ack b/ack index 28486531..e65ed440 100755 --- a/ack +++ b/ack @@ -689,12 +689,8 @@ sub file_loop_normal { sub print_matches_in_file { my $file = shift; - my $max_count = $opt_m || -1; # Go negative for no limit so it can never reduce to 0. - my $nmatches = 0; my $filename = $file->name; - my $has_printed_from_this_file = 0; - my $fh = $file->open; if ( !$fh ) { if ( $App::Ack::report_bad_filenames ) { @@ -709,6 +705,8 @@ sub print_matches_in_file { } # Check for context before the main loop, so we don't pay for it if we don't need it. + my $nmatches; + my $max_count = $opt_m || -1; # Go negative for no limit so it can never reduce to 0. if ( $is_tracking_context ) { $nmatches = pmif_context( $fh, $filename, $display_filename, $max_count ); }