From 1e8a8d35cead3b38f73a5d9cc93cdabad11eb5c3 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 5 Sep 2022 17:40:46 -0700 Subject: [PATCH] small optimization --- lib/Perl/Tidy/Formatter.pm | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/Perl/Tidy/Formatter.pm b/lib/Perl/Tidy/Formatter.pm index b3e27312..4670a7bc 100644 --- a/lib/Perl/Tidy/Formatter.pm +++ b/lib/Perl/Tidy/Formatter.pm @@ -14727,20 +14727,15 @@ EOM return if ( $max_index_to_go < 0 ); - $self->set_lp_indentation() - if ($rOpts_line_up_parentheses); + if ($rOpts_line_up_parentheses) { + $self->set_lp_indentation(); + } - #---------------------------- + #-------------------------------------------------- # Shortcut for block comments - #---------------------------- - if ( - $max_index_to_go == 0 - && $types_to_go[0] eq '#' - - # this shortcut does not work for -lp yet - && !$rOpts_line_up_parentheses - ) - { + # Note that this shortcut does not work for -lp yet + #-------------------------------------------------- + elsif ( $max_index_to_go == 0 && $types_to_go[0] eq '#' ) { my $ibeg = 0; $this_batch->[_ri_first_] = [$ibeg]; $this_batch->[_ri_last_] = [$ibeg]; -- 2.39.5