Minor: simplify isCalling

This commit is contained in:
Mikhail Glukhikh
2019-05-06 12:39:11 +03:00
parent 8913755e11
commit 7f1643cfad
@@ -59,7 +59,7 @@ fun KtCallExpression.isCalling(fqName: FqName, context: BindingContext = analyze
fun KtCallExpression.isCalling(fqNames: List<FqName>, context: BindingContext = analyze(BodyResolveMode.PARTIAL)): Boolean {
val calleeText = calleeExpression?.text ?: return false
val fqName = fqNames.firstOrNull { fqName -> fqName.asString().takeLastWhile { it != '.' } == calleeText } ?: return false
val fqName = fqNames.firstOrNull { fqName -> fqName.shortName().asString() == calleeText } ?: return false
return getResolvedCall(context)?.isCalling(fqName) == true
}