Cleanup: apply "Convert lambda to reference"

This commit is contained in:
Mikhail Glukhikh
2017-02-22 16:12:01 +03:00
parent b121bf8802
commit 045a23ae10
82 changed files with 117 additions and 135 deletions
@@ -102,7 +102,7 @@ class CodeBuilder(private val topElement: PsiElement?, private var docConverter:
if (commentInfo.isComment) {
// Original comment was first in line, but there's no line break before the current one
if (!commentInfo.isPostInsert && commentInfo.isFirstNonWhitespaceElementInLine &&
!builder.takeLastWhile { it.isWhitespace() }.contains('\n')) {
!builder.takeLastWhile(Char::isWhitespace).contains('\n')) {
builder.append('\n')
}
@@ -49,7 +49,7 @@ fun Converter.convertImport(anImport: PsiImportStatementBase, dumpConversion: Bo
}
else {
convertImport(fqName, reference, onDemand, anImport is PsiImportStaticStatement)
.map { Import(it) }
.map(::Import)
}
return convertedImports.map { it.assignPrototype(anImport) }
}