diff options
author | Guillem Jover <guillem@debian.org> | 2012-12-31 21:43:39 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-05-04 19:03:13 +0200 |
commit | 6a73e3078b01a71d4a6ea90c85da16523ed56f1d (patch) | |
tree | 4cc7a210e7e851395f7ba4989e3aac4aa9d32710 /scripts/Dpkg/Changelog/Entry.pm | |
parent | 62bc788a45e4a641c28ca9c8c5b9bb08f29faed8 (diff) | |
download | dpkg-6a73e3078b01a71d4a6ea90c85da16523ed56f1d.tar.gz |
Do not use double-quotes on strings that do not need interpolation
Using double-quotes imposes a small performance penalty as the perl
parser needs to check if any interpolation is needed. Use double-quotes
only when the string contains single-quotes. Ideally we'd use
double-quotes too for escaped meta-characters that might otherwise be
confusing to immediately see if they need interpolation or not, but the
policy does not (currently) allow to ignore these.
Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals.
Warned-by: perlcritic
Diffstat (limited to 'scripts/Dpkg/Changelog/Entry.pm')
-rw-r--r-- | scripts/Dpkg/Changelog/Entry.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/Dpkg/Changelog/Entry.pm b/scripts/Dpkg/Changelog/Entry.pm index 1f6907f65..f41444de7 100644 --- a/scripts/Dpkg/Changelog/Entry.pm +++ b/scripts/Dpkg/Changelog/Entry.pm @@ -18,7 +18,7 @@ package Dpkg::Changelog::Entry; use strict; use warnings; -our $VERSION = "1.00"; +our $VERSION = '1.00'; use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -110,7 +110,7 @@ lines) corresponding to the requested part. $part can be sub get_part { my ($self, $part) = @_; - internerr("invalid part of changelog entry: %s") unless exists $self->{$part}; + internerr('invalid part of changelog entry: %s') unless exists $self->{$part}; return $self->{$part}; } @@ -123,7 +123,7 @@ or an array ref. sub set_part { my ($self, $part, $value) = @_; - internerr("invalid part of changelog entry: %s") unless exists $self->{$part}; + internerr('invalid part of changelog entry: %s') unless exists $self->{$part}; if (ref($self->{$part})) { if (ref($value)) { $self->{$part} = $value; @@ -145,7 +145,7 @@ concatenated at the end of the current line. sub extend_part { my ($self, $part, $value, @rest) = @_; - internerr("invalid part of changelog entry: %s") unless exists $self->{$part}; + internerr('invalid part of changelog entry: %s') unless exists $self->{$part}; if (ref($self->{$part})) { if (ref($value)) { push @{$self->{$part}}, @$value; @@ -288,9 +288,9 @@ in the output format of C<dpkg-parsechangelog>. sub get_dpkg_changes { my ($self) = @_; - my $header = $self->get_part("header") || ""; + my $header = $self->get_part('header') || ''; $header =~ s/\s+$//; - return "\n$header\n\n" . join("\n", @{$self->get_part("changes")}); + return "\n$header\n\n" . join("\n", @{$self->get_part('changes')}); } =back |