Cleanup: post-cleanup after deprecation cleanup in compiler

Replace `takeIf { !expr }` with `takeUnless { expr }`.
Cleanup redundant parethesis as in `listOf((expr))`.
Replace `listOf(expr)` with `expr.let(::listOf)` where the former caused significant indentation change.
This commit is contained in:
Ilya Gorbunov
2017-03-17 16:06:28 +03:00
parent e599688733
commit dce0da68c6
24 changed files with 43 additions and 48 deletions
@@ -588,7 +588,7 @@ class ExpectedInfos(
val loopVar = forExpression.loopParameter
val loopVarType = if (loopVar != null && loopVar.typeReference != null)
(bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, loopVar] as VariableDescriptor).type.takeIf { !it.isError }
(bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, loopVar] as VariableDescriptor).type.takeUnless { it.isError }
else
null
@@ -478,7 +478,7 @@ class KotlinIndicesHelper(
val translatedDeclaration = declarationTranslator(this) ?: return emptyList()
if (!psiFilter(translatedDeclaration)) return emptyList()
return listOfNotNull((resolutionFacade.resolveToDescriptor(translatedDeclaration)))
return listOfNotNull(resolutionFacade.resolveToDescriptor(translatedDeclaration))
}
}
}