Hi. Is there any difference between ```suspend fun...
# exposed
b
Hi. Is there any difference between
Copy code
suspend fun <T> dbQuery(block: suspend () -> T): T = newSuspendedTransaction(<http://Dispatchers.IO|Dispatchers.IO>) { block() }

override suspend fun isEmailTaken(email: String): Boolean = dbQuery {
        UserEntity.find {
            UsersTable.email eq email
        }.firstOrNull()
    } == null
and
Copy code
override suspend fun isEmailTaken(email: String): Boolean = dbQuery {
        UserEntity.find {
            UsersTable.email eq email
        }.firstOrNull() == null
    }
? Should I check if the value exists in the another way?
t
I don't think there will be any difference. You can replace
firstOrNull() == null
with
.none()
or
.empty()
👍 1