Skip to content

Commit e0f2519

Browse files
committed
Kotlin polishing
1 parent a8b513a commit e0f2519

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/KotlinModelBuilderFunctions.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import org.mybatis.dynamic.sql.SqlTable
2121
import org.mybatis.dynamic.sql.insert.BatchInsertDSL
2222
import org.mybatis.dynamic.sql.insert.GeneralInsertDSL
2323
import org.mybatis.dynamic.sql.insert.InsertDSL
24-
import org.mybatis.dynamic.sql.insert.InsertSelectModel
2524
import org.mybatis.dynamic.sql.insert.MultiRowInsertDSL
2625

2726
/**
@@ -48,14 +47,13 @@ object KotlinModelBuilderFunctions {
4847
fun insertInto(table: SqlTable, completer: GeneralInsertCompleter) =
4948
GeneralInsertDSL.insertInto(table).apply(completer).build()
5049

51-
fun insertSelect(table: SqlTable, completer: InsertSelectCompleter): InsertSelectModel {
50+
fun insertSelect(table: SqlTable, completer: InsertSelectCompleter) =
5251
with(KotlinInsertSelectSubQueryBuilder().apply(completer)) {
53-
return SqlBuilder.insertInto(table)
52+
SqlBuilder.insertInto(table)
5453
.withColumnList(columnList)
5554
.withSelectStatement(this)
5655
.build()
5756
}
58-
}
5957

6058
fun <T> BatchInsertDSL.IntoGatherer<T>.into(table: SqlTable, completer: BatchInsertCompleter<T>) =
6159
into(table).also(completer).build()

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/KotlinUpdateBuilder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class KotlinUpdateBuilder(private val dsl: UpdateDSL<UpdateModel>) :
8282
}
8383

8484
private fun applyToDsl(block: UpdateDSL<UpdateModel>.() -> Unit) =
85-
this@KotlinUpdateBuilder.also {
86-
it.dsl.apply(block)
85+
this@KotlinUpdateBuilder.apply {
86+
dsl.apply(block)
8787
}
8888
}
8989
}

0 commit comments

Comments
 (0)