summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugMail.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-04-05 21:46:33 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-04-05 21:46:33 +0200
commitb1886835c81c014c1423fa2f2d83e157cbde1406 (patch)
tree7b2286b8768e97632ff6510efefad067db493c31 /Bugzilla/BugMail.pm
parent0d95dec384fc94b6ebaa5158a579aa099574cd59 (diff)
downloadbugzilla-b1886835c81c014c1423fa2f2d83e157cbde1406.tar.gz
bugzilla-b1886835c81c014c1423fa2f2d83e157cbde1406.tar.xz
Bug 1143874: Improve load time of bug comments
r=dkl a=sgreen
Diffstat (limited to 'Bugzilla/BugMail.pm')
-rw-r--r--Bugzilla/BugMail.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index f655c4ae6..bfb57f158 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -38,9 +38,6 @@ sub relationships {
return %relationships;
}
-# This is a bit of a hack, basically keeping the old system()
-# cmd line interface. Should clean this up at some point.
-#
# args: bug_id, and an optional hash ref which may have keys for:
# changer, owner, qa, reporter, cc
# Optional hash contains values of people which will be forced to those
@@ -88,6 +85,8 @@ sub Send {
@diffs = _get_new_bugmail_fields($bug);
}
+ my $comments = [];
+
if ($params->{dep_only}) {
push(@diffs, { field_name => 'bug_status',
old => $params->{changes}->{bug_status}->[0],
@@ -104,14 +103,14 @@ sub Send {
}
else {
push(@diffs, _get_diffs($bug, $end, \%user_cache));
- }
- my $comments = $bug->comments({ after => $start, to => $end });
- # Skip empty comments.
- @$comments = grep { $_->type || $_->body =~ /\S/ } @$comments;
+ $comments = $bug->comments({ after => $start, to => $end });
+ # Skip empty comments.
+ @$comments = grep { $_->type || $_->body =~ /\S/ } @$comments;
- # If no changes have been made, there is no need to process further.
- return {'sent' => []} unless scalar(@diffs) || scalar(@$comments);
+ # If no changes have been made, there is no need to process further.
+ return {'sent' => []} unless scalar(@diffs) || scalar(@$comments);
+ }
###########################################################################
# Start of email filtering code