Skip to content

Commit

Permalink
Fast exit undef/empty strings in Data::Dumper::qquote()
Browse files Browse the repository at this point in the history
This silences a squajillion (okay, five) "uninitialized" warnings,
and is more efficient, anyway...
  • Loading branch information
DabeDotCom committed Jun 19, 2024
1 parent 7c3742a commit ef8a989
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dist/Data-Dumper/Dumper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ our ( $Indent, $Trailingcomma, $Purity, $Pad, $Varname, $Useqq, $Terse, $Freezer
our ( @ISA, @EXPORT, @EXPORT_OK, $VERSION );

BEGIN {
$VERSION = '2.189'; # Don't forget to set version and release
$VERSION = '2.190'; # Don't forget to set version and release
# date in POD below!

@ISA = qw(Exporter);
Expand Down Expand Up @@ -760,6 +760,7 @@ my $low_controls_re = qr/[$low_controls]/;
# put a string value in double quotes
sub qquote {
local($_) = shift;
return qq("") unless length; # fast exit if undef/empty
s/([\\\"\@\$])/\\$1/g;

# This efficiently changes the high ordinal characters to \x{} if the utf8
Expand Down Expand Up @@ -1455,7 +1456,7 @@ modify it under the same terms as Perl itself.
=head1 VERSION
Version 2.189
Version 2.190
=head1 SEE ALSO
Expand Down

0 comments on commit ef8a989

Please sign in to comment.