Skip to content

Commit 101fea6

Browse files
committed
Use ternary expression
1 parent 3e871d2 commit 101fea6

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/main/java/org/apache/commons/codec/binary/StringUtils.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,7 @@ public static ByteBuffer getByteBufferUtf8(final String string) {
124124
* @return the encoded bytes
125125
*/
126126
private static byte[] getBytes(final String string, final Charset charset) {
127-
if (string == null) {
128-
return null;
129-
}
130-
return string.getBytes(charset);
127+
return string == null ? null : string.getBytes(charset);
131128
}
132129

133130
/**

0 commit comments

Comments
 (0)