Trailing comma: cleanup code after review

#KT-34744
This commit is contained in:
Dmitry Gridin
2020-01-23 01:32:22 +07:00
parent ac8a8ecab4
commit 80194dd536
4 changed files with 13 additions and 13 deletions
@@ -671,5 +671,5 @@ fun getTrailingCommaByClosingElement(closingElement: PsiElement?): PsiElement? {
fun getTrailingCommaByElementsList(elementList: PsiElement?): PsiElement? {
val lastChild = elementList?.lastChild?.let { if (it !is PsiComment) it else it.getPrevSiblingIgnoringWhitespaceAndComments() }
return lastChild?.run { if (node.elementType == KtTokens.COMMA) this else null }
return lastChild?.takeIf { it.node.elementType == KtTokens.COMMA }
}