Avoid putting trivial information into DelegatingDataFlowInfo map

This commit is contained in:
Denis Zharkov
2018-08-06 16:27:10 +07:00
parent d20e5ce673
commit 9297babc20
@@ -366,13 +366,16 @@ internal class DelegatingDataFlowInfo private constructor(
updatedNullabilityInfo.entries.fold(
parent?.completeNullabilityInfo ?: EMPTY_NULLABILITY_INFO
) { result, (dataFlowValue, nullability) ->
result.put(dataFlowValue, nullability)
if (dataFlowValue.immanentNullability != nullability)
result.put(dataFlowValue, nullability)
else
result.remove(dataFlowValue)
}
var resultingTypeInfo = parent?.completeTypeInfo ?: EMPTY_TYPE_INFO
valueToClearPreviousTypeInfo?.let {
resultingTypeInfo = resultingTypeInfo.put(it, ImmutableLinkedHashSet.empty())
resultingTypeInfo = resultingTypeInfo.remove(it)
}
for ((value, types) in updatedTypeInfo) {