Small refactoring: replaced code with 'getOrPut' library function

This commit is contained in:
Svetlana Isakova
2014-11-17 15:07:15 +03:00
parent 2948ca9077
commit e31e63aabe
@@ -38,12 +38,7 @@ public class SubstitutingScope(private val workerScope: JetScope, private val su
substitutedDescriptors = HashMap<DeclarationDescriptor, DeclarationDescriptor>()
}
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?