From 3f0e3902f0bc282d8823e9bdbb97b836063358f0 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 7 Jul 2017 13:57:36 +0300 Subject: [PATCH] More cleanup: lift return / assignment out Original commit: dfe2c16bc7a1e6fa77864d8e662ff2734bd2cddd --- .../kotlin/compilerRunner/JpsKotlinCompilerRunner.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt index b3f71c05b45..c32fe8ac171 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt @@ -224,12 +224,10 @@ class JpsKotlinCompilerRunner : KotlinCompilerRunner() { } } - private fun getReturnCodeFromObject(rc: Any?): String { - when { - rc == null -> return INTERNAL_ERROR - ExitCode::class.java.name == rc::class.java.name -> return rc.toString() - else -> throw IllegalStateException("Unexpected return: " + rc) - } + private fun getReturnCodeFromObject(rc: Any?): String = when { + rc == null -> INTERNAL_ERROR + ExitCode::class.java.name == rc::class.java.name -> rc.toString() + else -> throw IllegalStateException("Unexpected return: " + rc) } override fun getDaemonConnection(environment: JpsCompilerEnvironment): CompileServiceSession? =