Commit abeb2964 authored by Max Kanat-Alexander's avatar Max Kanat-Alexander

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

performance improvement. r=glob, a=LpSolit
parent 09df4b6f
......@@ -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);
}
......
......@@ -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 %]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment