]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 499151: Only call format_comment when it's actually needed, as a slight
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Sat, 20 Feb 2010 19:54:52 +0000 (11:54 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Sat, 20 Feb 2010 19:54:52 +0000 (11:54 -0800)
performance improvement.
r=glob, a=LpSolit

Bugzilla/Comment.pm
template/en/default/bug/format_comment.txt.tmpl

index e81819652398152f4588b24045c1027e5a51b7dc..58e1e7a7332d384af6c4a324acaceaa5702d7424 100644 (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);
     }
index 27b72a918df4a297282481684bfa7e12fb656302..7d33c23b30ec0e512bc5d5430a70a7ffeb7bca57 100644 (file)
@@ -65,6 +65,4 @@ Comment on attachment [% comment.extra_data %]
 [%+ comment.attachment.description %]
 
 [%+ comment.body %]
-[% ELSE %]
-X[% comment_body %]
 [% END %]