From abeb296487b58e9f03a3c0eea7b051874014b501 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Sat, 20 Feb 2010 11:52:25 -0800 Subject: Bug 499151: Only call format_comment when it's actually needed, as a slight performance improvement. r=glob, a=LpSolit --- Bugzilla/Comment.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Bugzilla/Comment.pm') diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index 60d26012f..f19c64d78 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); } -- cgit v1.2.3-24-g4f1b