Minor cosmetic readability fixes in VarargLowering

^KT-40689 fixed
This commit is contained in:
Shagen Ogandzhanian
2021-01-08 04:13:12 +01:00
committed by TeamCityServer
parent c996161db0
commit 31f5bcfaef
@@ -119,7 +119,7 @@ private class VarargTransformer(
for (e in expression.elements) { for (e in expression.elements) {
when (e) { when (e) {
is IrSpreadElement -> { is IrSpreadElement -> {
if (!currentList.isEmpty()) { if (currentList.isNotEmpty()) {
segments.add(arrayInfo.toPrimitiveArrayLiteral(currentList)) segments.add(arrayInfo.toPrimitiveArrayLiteral(currentList))
currentList.clear() currentList.clear()
} }
@@ -131,7 +131,7 @@ private class VarargTransformer(
} }
} }
} }
if (!currentList.isEmpty()) { if (currentList.isNotEmpty()) {
segments.add(arrayInfo.toPrimitiveArrayLiteral(currentList)) segments.add(arrayInfo.toPrimitiveArrayLiteral(currentList))
currentList.clear() currentList.clear()
} }
@@ -207,7 +207,7 @@ private class VarargTransformer(
if (argument == null && varargElementType != null) { if (argument == null && varargElementType != null) {
val arrayInfo = InlineClassArrayInfo(varargElementType, parameter.type) val arrayInfo = InlineClassArrayInfo(varargElementType, parameter.type)
val emptyArray = with (arrayInfo) { val emptyArray = with (arrayInfo) {
boxArrayIfNeeded(toPrimitiveArrayLiteral(emptyList<IrExpression>())) boxArrayIfNeeded(toPrimitiveArrayLiteral(emptyList()))
} }
expression.putValueArgument(i, emptyArray) expression.putValueArgument(i, emptyArray)