diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt index ed2f1218df..710f6a2845 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/Queries.kt @@ -269,10 +269,7 @@ private fun FieldSet.selectBatched( } private fun toLong(autoIncVal: Any): Long = when (autoIncVal) { - is EntityID<*> -> when (val value = autoIncVal.value) { - is Int -> value.toLong() - else -> value as Long - } + is EntityID<*> ->toLong(autoIncVal.value) is Int -> autoIncVal.toLong() else -> autoIncVal as Long }