[FIR] Simplify getSingleExpectForActualOrNull

When compatibleOnly == false, the logic was equivalent to returning
singleOrNull.
The only call-site with compatibleOnly = true was FirElementSerializer,
but after the fix for KT-59613, the map will never contain multiple
entries when one of the entries is compatible.
Assuming that we only run serialization on green code, the map will
either contain one compatible entry or no entries which makes the
additional check redundant.
This commit is contained in:
Kirill Rakhman
2023-07-03 16:58:53 +02:00
committed by Space Team
parent b68962018c
commit 1d3a127f52
2 changed files with 5 additions and 17 deletions
@@ -702,7 +702,7 @@ class FirElementSerializer private constructor(
val builder = ProtoBuf.ValueParameter.newBuilder()
val declaresDefaultValue = parameter.defaultValue != null ||
function.symbol.getSingleExpectForActualOrNull(compatibleOnly = true).containsDefaultValue(index)
function.symbol.getSingleExpectForActualOrNull().containsDefaultValue(index)
val flags = Flags.getValueParameterFlags(
additionalAnnotations.isNotEmpty()