This speeds up perltidy by about 2% for most perl scripts.
to limit tidy operations to a limited line range. Line numbers start
with 1. The man pages have details.
- - This version runs about five percent faster than the previous release
- on large files.
+ - This version runs about 7% faster than the previous release on
+ large files.
## 2023 07 01
# encodings sometimes works but can sometimes lead to disaster by
# using an incorrect decoding.
- my $decoder = guess_encoding( ${$rinput_string}, 'utf8' );
- if ( ref($decoder) ) {
+ my $decoder;
+ if ( ${$rinput_string} =~ /[^[:ascii:]]/ ) {
+ $decoder = guess_encoding( ${$rinput_string}, 'utf8' );
+ }
+ if ( $decoder && ref($decoder) ) {
$encoding_in = $decoder->name;
if ( $encoding_in ne 'UTF-8' && $encoding_in ne 'utf8' ) {
$encoding_in = EMPTY_STRING;