mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Avoid reallocation inserting logs into database
This commit is contained in:
committed by
Cody Henthorne
parent
57454a2661
commit
7074684474
@@ -160,7 +160,7 @@ class LogDatabase private constructor(
|
||||
private val readableDatabase: SQLiteDatabase get() = openHelper.readableDatabase
|
||||
private val writableDatabase: SQLiteDatabase get() = openHelper.writableDatabase
|
||||
|
||||
fun insert(logs: List<LogEntry>, currentTime: Long) {
|
||||
fun insert(logs: Sequence<LogEntry>, currentTime: Long) {
|
||||
writableDatabase.withinTransaction { db ->
|
||||
logs.forEach { log ->
|
||||
db.insertInto(TABLE_NAME)
|
||||
|
||||
Reference in New Issue
Block a user