[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 06/15: r/html_reports: Move invariants out of the loop



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

nthykier pushed a commit to branch master
in repository lintian.

commit 8503ad974cd9ee7783626a7b38ee1391bb83db5f
Author: Niels Thykier <niels@thykier.net>
Date:   Fri Feb 7 22:36:28 2014 +0100

    r/html_reports: Move invariants out of the loop
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 reporting/html_reports | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/reporting/html_reports b/reporting/html_reports
index e645d58..f9de05a 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -184,6 +184,14 @@ my (%by_maint, %by_uploader, %by_tag);
 # just assume that the second maintainer is the same as the first (but warn
 # about it).
 my (%seen, %saw_maintainer);
+my %expanded_code = (
+    E => 'errors',
+    W => 'warnings',
+    I => 'info',
+    X => 'experimental',
+    O => 'overridden',
+    P => 'pedantic',
+);
 
 while (<>) {
     my @parts;
@@ -200,14 +208,7 @@ while (<>) {
     next unless $tag_info;
 
     # Update statistics.
-    my $key = {
-        E => 'errors',
-        W => 'warnings',
-        I => 'info',
-        X => 'experimental',
-        O => 'overridden',
-        P => 'pedantic',
-    }->{$code};
+    my $key = $expanded_code{$code};
     $statistics{$key}++;
     unless ($seen{"$package $type"}) {
         $statistics{"$type-packages"}++;

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


Reply to: