[Java. Code Formatting] Simplify BasicLiteralUtil#getTextBlockIndent

IDEA-351758

GitOrigin-RevId: 7eb8bdeb2b12446266d18dea180196560023617e
This commit is contained in:
Georgii Ustinov
2024-05-09 13:15:24 +03:00
committed by intellij-monorepo-bot
parent 3f278e2717
commit 69c61c874b

View File

@@ -105,11 +105,7 @@ public final class BasicLiteralUtil {
private static @NotNull String getTextBlockIndentString(String @NotNull [] lines) {
IndentResult result = getTextBlockIndentInner(lines, true, false);
String restorationLine = lines[result.indentLineNumber];
StringBuilder builder = new StringBuilder();
for (int i = 0; i < result.indentSize; ++i) {
builder.append(restorationLine.charAt(i));
}
return builder.toString();
return restorationLine.substring(0, result.indentSize);
}
private static class IndentResult {