Bug 499151: Only call format_comment when it's actually needed, as a slight

performance improvement.
r=glob, a=LpSolit


git-svn-id: svn://10.0.0.236/trunk@259768 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkanat%bugzilla.org 2010-02-20 20:03:56 +00:00
parent bcd3592f3b
commit 539d396c69
3 changed files with 11 additions and 8 deletions

View File

@ -1 +1 @@
7011
7012

View File

@ -119,10 +119,15 @@ sub body_full {
$params ||= {};
my $template = Bugzilla->template_inner;
my $body;
$template->process("bug/format_comment.txt.tmpl",
{ comment => $self, %$params }, \$body)
|| ThrowTemplateError($template->error());
$body =~ s/^X//;
if ($self->type) {
$template->process("bug/format_comment.txt.tmpl",
{ comment => $self, %$params }, \$body)
|| ThrowTemplateError($template->error());
$body =~ s/^X//;
}
else {
$body = $self->body;
}
if ($params->{wrap} and !$self->already_wrapped) {
$body = wrap_comment($body);
}

View File

@ -63,8 +63,6 @@ Comment on attachment [% comment.extra_data %]
[%+ comment.attachment.description %]
[%+ comment.body %]
[% ELSIF comment.type %]
[% Hook.process('type') %]
[% ELSE %]
X[% comment_body %]
X[% Hook.process('type') %]
[% END %]