Set default instead of null check

This commit is contained in:
Josh (Vicarious) authored and GitHub committed 2020-08-24 22:52:06 -07:00
1 parent 33f907e237
commit f7077316b1
1 file changed
+3 -7
@@ -86,13 +86,9 @@ public class ChannelListCommand extends BaseCommand {
}
private void makeList(Iterator<ChatChannel> iterator, TextComponent.Builder list) {
String listSeparator = carbonChat.getLanguage().getString("channel-list-separator");
Component listSeparatorComponent;
if (listSeparator != null) {
listSeparatorComponent = TextComponent.of(listSeparator);
} else {
listSeparatorComponent = TextComponent.of(", ");
}
String listSeparator = carbonChat.getLanguage().getString("channel-list-separator", ", ");
Component listSeparatorComponent = listSeparatorComponent = TextComponent.of(listSeparator);
while (iterator.hasNext()) {
ChatChannel channel = iterator.next();
list.append(TextComponent.of(channel.getName()));