[Reproducible-commits] [dpkg] 26/90: Dpkg::Changelog::Entry::Debian: Simplify distribution splitting

Jérémy Bobbio lunar at moszumanska.debian.org
Sat Aug 29 18:26:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit 8f222426e6e9254150f09b579766a839c02910de
Author: Guillem Jover <guillem at debian.org>
Date:   Sat Jul 11 01:08:43 2015 +0200

    Dpkg::Changelog::Entry::Debian: Simplify distribution splitting
    
    Use «split(' ', $string)», instead of removing the heading whitespace
    and then using «split(/\s+/, $string)». This should be faster too.
---
 debian/changelog                       | 1 +
 scripts/Dpkg/Changelog/Entry/Debian.pm | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b5e2dbc..3668a86 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ dpkg (1.18.2) UNRELEASED; urgency=low
     - Use Time::Piece (part of the perl core distribution) instead of
       Date::Parse in Dpkg::Changelog::Entry::Debian. This reduces the build
       and run-time dependencies, and helps architecture bootstrapping.
+    - Simplify distribution splitting in Dpkg::Changelog::Entry::Debian.
   * Documentation:
     - Fix grammar in dpkg-architecture(1).
       Thanks to Chris Lamb <lamby at debian.org>. Closes: #787616
diff --git a/scripts/Dpkg/Changelog/Entry/Debian.pm b/scripts/Dpkg/Changelog/Entry/Debian.pm
index 5a50ff1..e1d0b33 100644
--- a/scripts/Dpkg/Changelog/Entry/Debian.pm
+++ b/scripts/Dpkg/Changelog/Entry/Debian.pm
@@ -211,9 +211,7 @@ sub get_version {
 sub get_distributions {
     my $self = shift;
     if (defined($self->{header}) and $self->{header} =~ $regex_header) {
-	my $value = $3;
-	$value =~ s/^\s+//;
-	my @dists = split(/\s+/, $value);
+	my @dists = split ' ', $3;
 	return @dists if wantarray;
 	return $dists[0];
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list