From: Max Kanat-Alexander Date: Sat, 20 Feb 2010 19:54:52 +0000 (-0800) Subject: Bug 499151: Only call format_comment when it's actually needed, as a slight X-Git-Tag: bugzilla-3.6rc1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f30b67fde4ffa63eef648b35cddd7bedd9141c1c;p=thirdparty%2Fbugzilla.git Bug 499151: Only call format_comment when it's actually needed, as a slight performance improvement. r=glob, a=LpSolit --- diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index e818196523..58e1e7a733 100644 --- a/Bugzilla/Comment.pm +++ b/Bugzilla/Comment.pm @@ -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); } diff --git a/template/en/default/bug/format_comment.txt.tmpl b/template/en/default/bug/format_comment.txt.tmpl index 27b72a918d..7d33c23b30 100644 --- a/template/en/default/bug/format_comment.txt.tmpl +++ b/template/en/default/bug/format_comment.txt.tmpl @@ -65,6 +65,4 @@ Comment on attachment [% comment.extra_data %] [%+ comment.attachment.description %] [%+ comment.body %] -[% ELSE %] -X[% comment_body %] [% END %]