The following commit has been merged in the master branch:
commit 145acbe00519fa7e0af9214c33fa6818e391044c
Author: Raphael Geissert <[email protected]>
Date:   Wed Feb 11 13:33:34 2009 -0600

    Minor lib/Util.pm optimizations
    
    Minor optimizations: Skip line in control file if it is a comment before
    attempting to correct tabs.  Do not create a FileHandle object as it is 
never
    used.

diff --git a/lib/Util.pm b/lib/Util.pm
index 688f1f0..9d49332 100644
--- a/lib/Util.pm
+++ b/lib/Util.pm
@@ -72,10 +72,10 @@ sub parse_dpkg_control {
     local $_;
     while (<$CONTROL>) {
        chomp;
+       next if /^#/; #comment line?
 
        # tabs at the beginning are illegal, but handle them anyways
        s/^\t/ \t/o;
-       next if /^#/; #comment line?
 
        # empty line?
        if ((!$debconf_flag && m/^\s*$/) or 
@@ -133,8 +133,7 @@ sub read_dpkg_control {
        return undef;
     }
 
-    my $CONTROL = FileHandle->new;
-    open($CONTROL, '<', $file)
+    open(my $CONTROL, '<', $file)
        or fail("cannot open control file $file for reading: $!");
     my @data = parse_dpkg_control($CONTROL, $debconf_flag);
     close($CONTROL)

-- 
Debian package checker


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to