[KLIB] Improve performance a bit

This commit is contained in:
Roman Artemev
2020-05-15 17:44:58 +03:00
committed by romanart
parent 44dfae53f0
commit 7644b4baec
2 changed files with 4 additions and 2 deletions
@@ -919,7 +919,9 @@ abstract class IrFileDeserializer(val logger: LoggingContext, val builtIns: IrBu
} }
private fun eraseDelegatedSymbol(symbol: IrSymbol) { private fun eraseDelegatedSymbol(symbol: IrSymbol) {
delegatedSymbolMap.remove(symbol) if (symbol is IrDelegatingSymbol<*, *, *>) {
delegatedSymbolMap.remove(symbol)
}
} }
private inline fun <T : IrDeclarationParent> T.usingParent(block: T.() -> Unit): T = private inline fun <T : IrDeclarationParent> T.usingParent(block: T.() -> Unit): T =
@@ -1233,7 +1233,7 @@ open class IrFileSerializer(
// TODO: keep order similar // TODO: keep order similar
val sigIndex = protoIdSignatureMap[idSig] ?: error("Not found ID for $idSig (${it.render()})") val sigIndex = protoIdSignatureMap[idSig] ?: error("Not found ID for $idSig (${it.render()})")
topLevelDeclarations.add(TopLevelDeclaration(sigIndex, it.descriptor.toString(), byteArray)) topLevelDeclarations.add(TopLevelDeclaration(sigIndex, idSig.toString(), byteArray))
proto.addDeclarationId(sigIndex) proto.addDeclarationId(sigIndex)
} }