From 784d176ccb08af68e3b0b4cf3b28604f60934d7a Mon Sep 17 00:00:00 2001 From: Davide Palladino Date: Mon, 9 Dec 2024 13:57:42 +0100 Subject: [PATCH] Refactored StringValue.equals --- .../main/kotlin/com/smeup/rpgparser/interpreter/values.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt index bb450a698..c27c22080 100644 --- a/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt +++ b/rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/values.kt @@ -117,10 +117,9 @@ data class StringValue(var value: String, var varying: Boolean = false) : Abstra } override fun equals(other: Any?): Boolean { - return if (other is StringValue) { - this.value == other.value - } else { - false + return when (other) { + is StringValue -> this.value == other.value + else -> false } }