Prechádzať zdrojové kódy

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.
Guillem Jover 11 rokov pred
rodič
commit
8f222426e6

+ 1 - 0
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@debian.org>. Closes: #787616

+ 1 - 3
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];
     }