Minor refactoring

This commit is contained in:
Valentin Kipyatkov
2020-02-10 11:15:04 +02:00
parent af32cad1ae
commit 1b5b0d2839
3 changed files with 3 additions and 3 deletions
@@ -86,7 +86,7 @@ class InflowSlicer(
} }
private fun processParameter(parameter: KtParameter, includeOverriders: Boolean) { private fun processParameter(parameter: KtParameter, includeOverriders: Boolean) {
if (!parameter.canProcess()) return if (!canProcessParameter(parameter)) return
val function = parameter.ownerFunction ?: return val function = parameter.ownerFunction ?: return
@@ -35,7 +35,7 @@ class OutflowSlicer(
} }
private fun processVariable(variable: KtCallableDeclaration) { private fun processVariable(variable: KtCallableDeclaration) {
if (variable is KtParameter && !variable.canProcess()) return if (variable is KtParameter && !canProcessParameter(variable)) return
val withDereferences = parentUsage.params.showInstanceDereferences val withDereferences = parentUsage.params.showInstanceDereferences
val accessKind = if (withDereferences) AccessKind.READ_OR_WRITE else AccessKind.READ_ONLY val accessKind = if (withDereferences) AccessKind.READ_OR_WRITE else AccessKind.READ_ONLY
@@ -130,7 +130,7 @@ abstract class Slicer(
} }
} }
protected fun KtParameter.canProcess() = !isVarArg protected fun canProcessParameter(parameter: KtParameter) = !parameter.isVarArg
protected val DeclarationDescriptorWithSource.originalSource: SourceElement protected val DeclarationDescriptorWithSource.originalSource: SourceElement
get() { get() {