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

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=2d02a12697808b01b360e7ceb52864c0873f7eac

commit 2d02a12697808b01b360e7ceb52864c0873f7eac
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Jun 16 18:33:15 2018 +0200

    Dpkg::Vendor::Debian: Inline _parse_feature_area() into _add_build_flags()
    
    This function was being called on each foreach iteration to parse the
    options within the DEB_BUILD_MAINT_OPTIONS and DEB_BUILD_OPTIONS
    environment variables, and needed to parse these at construction time
    every time. Inlining it should make it more performant and in addition
    reduce line count.
---
 debian/changelog              |  2 ++
 scripts/Dpkg/Vendor/Debian.pm | 20 +++++++-------------
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2bd44d571..98146943d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -123,6 +123,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium
       on scalar context to denote it is *not* deprecated instead of being
       version 0.
     - Dpkg::Shlibs: Disable bool overload Dpkg::Version warnings.
+    - Dpkg::Vendor::Debian: Inline _parse_feature_area() into
+      _add_build_flags(), for a small speed up and line count reduction.
   * Documentation:
     - Update gettext minimal version in README.
     - Add a missing dot on the dpkg-buildflags(1) «lfs» feature paragraph.
diff --git a/scripts/Dpkg/Vendor/Debian.pm b/scripts/Dpkg/Vendor/Debian.pm
index 814948e83..2e42a8b86 100644
--- a/scripts/Dpkg/Vendor/Debian.pm
+++ b/scripts/Dpkg/Vendor/Debian.pm
@@ -86,18 +86,6 @@ sub run_hook {
     }
 }
 
-sub _parse_feature_area {
-    my ($self, $area, $use_feature) = @_;
-
-    require Dpkg::BuildOptions;
-
-    # Adjust features based on user or maintainer's desires.
-    my $opts = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS');
-    $opts->parse_features($area, $use_feature);
-    $opts = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_MAINT_OPTIONS');
-    $opts->parse_features($area, $use_feature);
-}
-
 sub _add_build_flags {
     my ($self, $flags) = @_;
 
@@ -141,9 +129,15 @@ sub _add_build_flags {
 
     ## Setup
 
+    require Dpkg::BuildOptions;
+
     # Adjust features based on user or maintainer's desires.
+    my $opts_build = Dpkg::BuildOptions->new(envvar => 'DEB_BUILD_OPTIONS');
+    my $opts_maint = Dpkg::BuildOptions->new(envvar => 
'DEB_BUILD_MAINT_OPTIONS');
+
     foreach my $area (sort keys %use_feature) {
-        $self->_parse_feature_area($area, $use_feature{$area});
+        $opts_build->parse_features($area, $use_feature{$area});
+        $opts_maint->parse_features($area, $use_feature{$area});
     }
 
     require Dpkg::Arch;

-- 
Dpkg.Org's dpkg

Reply via email to