Small refactoring: replaced code with 'getOrPut' library function
This commit is contained in:
@@ -38,12 +38,7 @@ public class SubstitutingScope(private val workerScope: JetScope, private val su
|
|||||||
substitutedDescriptors = HashMap<DeclarationDescriptor, DeclarationDescriptor>()
|
substitutedDescriptors = HashMap<DeclarationDescriptor, DeclarationDescriptor>()
|
||||||
}
|
}
|
||||||
|
|
||||||
var substituted: DeclarationDescriptor? = substitutedDescriptors!!.get(descriptor)
|
val substituted = substitutedDescriptors!!.getOrPut(descriptor, { descriptor.substitute(substitutor) })
|
||||||
if (substituted == null && !substitutedDescriptors!!.containsKey(descriptor)) {
|
|
||||||
substituted = descriptor.substitute(substitutor)
|
|
||||||
|
|
||||||
substitutedDescriptors!!.put(descriptor, substituted)
|
|
||||||
}
|
|
||||||
|
|
||||||
[suppress("UNCHECKED_CAST")]
|
[suppress("UNCHECKED_CAST")]
|
||||||
return substituted as D?
|
return substituted as D?
|
||||||
|
|||||||
Reference in New Issue
Block a user