# Nested subs are used for error handling in Tidy.pm.
[-Subroutines::ProhibitNestedSubs]
-# In critical routines this can significantly reduce processing speed.
-# So we have to skip it.
-[-Subroutines::RequireArgUnpacking]
+[Subroutines::RequireArgUnpacking]
+short_subroutine_statements = 2
# Completely Disagree. The advantages of 'use constant' greatly outweigh the
# few disadvantages. Perl::Tidy relies heavily on constants for efficient and
@{is_binary_type}{@q} = (1) x scalar(@q);
# token keywords which prevent using leading word as a container name
- @_ = qw(and or err eq ne cmp);
- @is_binary_keyword{@_} = (1) x scalar(@_);
+ @q = qw(and or err eq ne cmp);
+ @is_binary_keyword{@q} = (1) x scalar(@q);
# Some common function calls whose args can be aligned. These do not
# give good alignments if the lengths differ significantly.
my $jmax_new = $line_0->{'jmax'};
$new_alignments[ $jmax_new - 1 ] = $old_alignments[ $jmax_old - 1 ];
- $new_alignments[$jmax_new] = $old_alignments[$jmax_old];
- $line_0->{'ralignments'} = \@new_alignments;
- $line_1->{'ralignments'} = \@new_alignments;
+ $new_alignments[$jmax_new] = $old_alignments[$jmax_old];
+ $line_0->{'ralignments'} = \@new_alignments;
+ $line_1->{'ralignments'} = \@new_alignments;
return;
}
return $self;
}
- # This sub is called many times and has been optimized a bit
sub get_column {
- ##my ( $self, $j ) = @_;
- my $alignment = $_[0]->{ralignments}->[ $_[1] ];
+ my ( $self, $j ) = @_;
+ my $alignment = $self->{ralignments}->[$j];
return unless defined($alignment);
return $alignment->get_column();
}