From cbd3d9481981266b3e00899790e0ed1777967852 Mon Sep 17 00:00:00 2001 From: Yongshun Ye Date: Sun, 19 Apr 2026 02:19:51 +0800 Subject: [PATCH] refactor: golf/simplify `Column.check` Verified with the IntelliJ IDEA "Inline Function" feature that the result is identical to the original. --- .../src/main/kotlin/org/jetbrains/exposed/v1/core/Table.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/exposed-core/src/main/kotlin/org/jetbrains/exposed/v1/core/Table.kt b/exposed-core/src/main/kotlin/org/jetbrains/exposed/v1/core/Table.kt index 461d90fb4d..b599696658 100644 --- a/exposed-core/src/main/kotlin/org/jetbrains/exposed/v1/core/Table.kt +++ b/exposed-core/src/main/kotlin/org/jetbrains/exposed/v1/core/Table.kt @@ -1737,12 +1737,7 @@ open class Table(name: String = "") : ColumnSet(), DdlAware { * @param op The expression against which the newly inserted values will be compared. */ fun Column.check(name: String = "", op: (Column) -> Op): Column = apply { - if (name.isEmpty() || table.checkConstraints.none { it.first.equals(name, true) }) { - table.checkConstraints.add(name to op(this)) - } else { - exposedLogger - .warn("A CHECK constraint with name '$name' was ignored because there is already one with that name") - } + table.check(name) { op(this) } } /**