[lintian] 14/15: r/html_reports: Save some calls to map_maintainer
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit d846899114db7b8a913aa191152b836eddc52b84
Author: Niels Thykier <niels@thykier.net>
Date: Sat Feb 8 13:31:15 2014 +0100
r/html_reports: Save some calls to map_maintainer
Signed-off-by: Niels Thykier <niels@thykier.net>
---
reporting/html_reports | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/reporting/html_reports b/reporting/html_reports
index 476d3fb..7366f47 100755
--- a/reporting/html_reports
+++ b/reporting/html_reports
@@ -183,7 +183,10 @@ my (%by_maint, %by_uploader, %by_tag);
# each other's pages. If we find two maintainers who map to the same URL,
# just assume that the second maintainer is the same as the first (but warn
# about it).
-my (%seen, $last_info);
+#
+# The "last_*" are optimizations to avoid computing the same things
+# over and over again when a package have multiple tags.
+my (%seen, $last_info, $last_maintainer);
my %expanded_code = (
E => 'errors',
W => 'warnings',
@@ -291,11 +294,6 @@ while (<>) {
$extra = '';
}
- # Check if we've seen the URL for this maintainer before and, if so, map
- # them to the same person as the previous one.
-
- $maintainer = map_maintainer($maintainer);
-
my $info;
# Add the tag information to our hashes. Share the data between the
@@ -329,7 +327,15 @@ while (<>) {
$info->{severity} = $tag_info->severity;
$info->{certainty} = $tag_info->certainty,
}
+ # saves a map_maintainer call
+ $maintainer = $last_maintainer;
} else {
+
+ # Check if we've seen the URL for this maintainer before and, if so, map
+ # them to the same person as the previous one.
+
+ $last_maintainer = $maintainer = map_maintainer($maintainer);
+
# Update maintainer statistics.
$statistics{maintainers}++ unless defined $by_maint{$maintainer};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: