From 16bd30aa7c0ec29962cd661518a4b7ad976eb77f Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 6 Oct 2020 06:05:50 -0700 Subject: [PATCH] improved efficiency of some routines in FileWriter.pm --- lib/Perl/Tidy/FileWriter.pm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/Perl/Tidy/FileWriter.pm b/lib/Perl/Tidy/FileWriter.pm index 32114e39..fa3e23f9 100644 --- a/lib/Perl/Tidy/FileWriter.pm +++ b/lib/Perl/Tidy/FileWriter.pm @@ -15,7 +15,7 @@ sub AUTOLOAD { # some diagnostic information. This sub should never be called # except for a programming error. our $AUTOLOAD; - return if ( $AUTOLOAD =~/\bDESTROY$/ ); + return if ( $AUTOLOAD =~ /\bDESTROY$/ ); my ( $pkg, $fname, $lno ) = caller(); print STDERR <[_output_line_number_]; + return $_[0]->[_output_line_number_]; } sub decrement_output_line_number { - my $self = shift; - $self->[_output_line_number_]--; + $_[0]->[_output_line_number_]--; return; } sub get_consecutive_nonblank_lines { - my $self = shift; - return $self->[_consecutive_nonblank_lines_]; + return $_[0]->[_consecutive_nonblank_lines_]; } sub reset_consecutive_blank_lines { - my $self = shift; - $self->[_consecutive_blank_lines_] = 0; + $_[0]->[_consecutive_blank_lines_] = 0; return; } -- 2.39.5