Inline the withinTransaction() function.

This commit is contained in:
Greyson Parrelli 2024-08-30 11:52:04 -04:00 committed by Nicholas Tinsley
parent 011a36c8f3
commit 2b1bbdda15

View file

@ -13,7 +13,7 @@ import androidx.sqlite.db.SupportSQLiteQueryBuilder
*
* @return The value returned by [block] if any
*/
fun <T : SupportSQLiteDatabase, R> T.withinTransaction(block: (T) -> R): R {
inline fun <T : SupportSQLiteDatabase, R> T.withinTransaction(block: (T) -> R): R {
beginTransaction()
try {
val toReturn = block(this)