diff --git a/core/descriptors/src/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.kt b/core/descriptors/src/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.kt index d259439e68f..de19946a732 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.kt +++ b/core/descriptors/src/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.kt @@ -38,12 +38,7 @@ public class SubstitutingScope(private val workerScope: JetScope, private val su substitutedDescriptors = HashMap() } - var substituted: DeclarationDescriptor? = substitutedDescriptors!!.get(descriptor) - if (substituted == null && !substitutedDescriptors!!.containsKey(descriptor)) { - substituted = descriptor.substitute(substitutor) - - substitutedDescriptors!!.put(descriptor, substituted) - } + val substituted = substitutedDescriptors!!.getOrPut(descriptor, { descriptor.substitute(substitutor) }) [suppress("UNCHECKED_CAST")] return substituted as D?