summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-20 20:52:25 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-20 20:52:25 +0100
commitabeb296487b58e9f03a3c0eea7b051874014b501 (patch)
tree800a1fbf707cfe36e77fc8b8c12d3f249f2a522b /Bugzilla
parent09df4b6fe6b6f589db00aef337d73c270e990bf0 (diff)
downloadbugzilla-abeb296487b58e9f03a3c0eea7b051874014b501.tar.gz
bugzilla-abeb296487b58e9f03a3c0eea7b051874014b501.tar.xz
Bug 499151: Only call format_comment when it's actually needed, as a slight
performance improvement. r=glob, a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Comment.pm13
1 files changed, 9 insertions, 4 deletions
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);
}