Skip to content

Commit

Permalink
Renames variable to increase the maintainability
Browse files Browse the repository at this point in the history
Fixes: SIRI-960
  • Loading branch information
mko-sci committed May 17, 2024
1 parent 0853e13 commit c42cc01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/sirius/kernel/commons/Strings.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,9 @@ private static String limit(@Nullable Object input,
charactersToPreserveAtTheEnd = 0;
}

String str = String.valueOf(input).trim();
if (str.length() <= length + charactersToPreserveAtTheEnd) {
return str;
String trimmedInputString = String.valueOf(input).trim();
if (trimmedInputString.length() <= length + charactersToPreserveAtTheEnd) {
return trimmedInputString;
}

String middle = generateTruncatedSignal(showEllipsis, showTruncated, charactersToPreserveAtTheEnd > 0);
Expand All @@ -474,8 +474,8 @@ private static String limit(@Nullable Object input,
effectiveLength = length;
}

String start = str.substring(0, effectiveLength).trim();
String end = str.substring(str.length() - charactersToPreserveAtTheEnd).trim();
String start = trimmedInputString.substring(0, effectiveLength).trim();
String end = trimmedInputString.substring(trimmedInputString.length() - charactersToPreserveAtTheEnd).trim();
return start + middle + end;
}

Expand Down

0 comments on commit c42cc01

Please sign in to comment.