Skip to content

Commit 125a97f

Browse files
committed
User ternary expression
1 parent ac0c6d6 commit 125a97f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/java/org/apache/commons/text/TextStringBuilder.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,13 +1185,10 @@ public TextStringBuilder appendNewLine() {
11851185
/**
11861186
* Appends the text representing {@code null} to this string builder.
11871187
*
1188-
* @return this, to enable chaining
1188+
* @return this, to enable chaining.
11891189
*/
11901190
public TextStringBuilder appendNull() {
1191-
if (nullText == null) {
1192-
return this;
1193-
}
1194-
return append(nullText);
1191+
return nullText != null ? append(nullText) : this;
11951192
}
11961193

11971194
/**

0 commit comments

Comments
 (0)