From 5fc1b86cfeeaf5e8e64dfbef3cd94f13a899d696 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Fri, 16 Nov 2012 18:10:32 +0100 Subject: Bug 797636: Improve performance for buglists r=dkl a=LpSolit --- Bugzilla/Template.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Bugzilla/Template.pm') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index d00799900..e13efec2b 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -562,10 +562,9 @@ $Template::Stash::SCALAR_OPS->{ 0 } = $Template::Stash::SCALAR_OPS->{ truncate } = sub { my ($string, $length, $ellipsis) = @_; - $ellipsis ||= ""; - return $string if !$length || length($string) <= $length; - + + $ellipsis ||= ''; my $strlen = $length - length($ellipsis); my $newstr = substr($string, 0, $strlen) . $ellipsis; return $newstr; -- cgit v1.2.3-24-g4f1b