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/Control.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/Control.pm')
-rw-r--r-- | scripts/Dpkg/Control.pm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/Dpkg/Control.pm b/scripts/Dpkg/Control.pm index 5efa17cb6..31149116a 100644 --- a/scripts/Dpkg/Control.pm +++ b/scripts/Dpkg/Control.pm @@ -18,7 +18,7 @@ package Dpkg::Control; use strict; use warnings; -our $VERSION = "1.00"; +our $VERSION = '1.00'; use Dpkg::Gettext; use Dpkg::ErrorHandling; @@ -147,23 +147,23 @@ sub set_options { $$self->{allow_pgp} = ($t & (CTRL_PKG_SRC | CTRL_FILE_CHANGES)) ? 1 : 0; $$self->{drop_empty} = ($t & (CTRL_INFO_PKG | CTRL_INFO_SRC)) ? 0 : 1; if ($t == CTRL_INFO_SRC) { - $$self->{name} = _g("general section of control info file"); + $$self->{name} = _g('general section of control info file'); } elsif ($t == CTRL_INFO_PKG) { $$self->{name} = _g("package's section of control info file"); } elsif ($t == CTRL_CHANGELOG) { - $$self->{name} = _g("parsed version of changelog"); + $$self->{name} = _g('parsed version of changelog'); } elsif ($t == CTRL_INDEX_SRC) { - $$self->{name} = sprintf(_g("entry in repository's %s file"), "Sources"); + $$self->{name} = sprintf(_g("entry in repository's %s file"), 'Sources'); } elsif ($t == CTRL_INDEX_PKG) { - $$self->{name} = sprintf(_g("entry in repository's %s file"), "Packages"); + $$self->{name} = sprintf(_g("entry in repository's %s file"), 'Packages'); } elsif ($t == CTRL_PKG_SRC) { - $$self->{name} = sprintf(_g("%s file"), ".dsc"); + $$self->{name} = sprintf(_g('%s file'), '.dsc'); } elsif ($t == CTRL_PKG_DEB) { - $$self->{name} = _g("control info of a .deb package"); + $$self->{name} = _g('control info of a .deb package'); } elsif ($t == CTRL_FILE_CHANGES) { - $$self->{name} = sprintf(_g("%s file"), ".changes"); + $$self->{name} = sprintf(_g('%s file'), '.changes'); } elsif ($t == CTRL_FILE_VENDOR) { - $$self->{name} = _g("vendor file"); + $$self->{name} = _g('vendor file'); } elsif ($t == CTRL_FILE_STATUS) { $$self->{name} = _g("entry in dpkg's status file"); } |