From 92f54b44774cfabe11f989a99ffb0062d8bdf832 Mon Sep 17 00:00:00 2001 From: mindless Date: Mon, 21 Sep 2009 17:37:46 +0000 Subject: [PATCH] avoid repeated maxDescrLength-ending.length() calculations in getTruncatedDescription git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21951 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Run.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index b0da66f451..ec125f4f48 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -445,8 +445,7 @@ public abstract class Run ,RunT extends Run,RunT extends Run') { inTag = false; - if (displayChars <= (maxDescrLength - ending.length())) { + if (displayChars <= maxTruncLength) { lastTruncatablePoint = i + 1; } } if (!inTag) { displayChars++; - if (displayChars <= (maxDescrLength - ending.length())) { - if (ch == ' ') { - lastTruncatablePoint = i; - } + if (displayChars <= maxTruncLength && ch == ' ') { + lastTruncatablePoint = i; } } } -- GitLab