summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-11-26 16:33:44 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-11-26 16:33:44 +0100
commitf36dc49c5b475b19201113f8a37cd5b226eed7d4 (patch)
tree2ca93ee6276b3a9b33cd23040c709e28990a397a /Bugzilla/Template.pm
parent79a12728c9f7ee27c427d93967f5c38bc467d297 (diff)
downloadbugzilla-f36dc49c5b475b19201113f8a37cd5b226eed7d4.tar.gz
bugzilla-f36dc49c5b475b19201113f8a37cd5b226eed7d4.tar.xz
Bug 812543 - Back port patch from bug 797636 to bmo/4.2 to bring in performance enhancements
r=glob
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index b35a9d269..18560c3f5 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -558,10 +558,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;