mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-22 20:18:36 +00:00
Improve performance of finding message positions in chats.
This commit is contained in:
committed by
Cody Henthorne
parent
d628921e48
commit
6db71f4a39
@@ -1,6 +1,7 @@
|
||||
package org.signal.core.util
|
||||
|
||||
import android.database.Cursor
|
||||
import androidx.core.database.getLongOrNull
|
||||
import java.util.Optional
|
||||
|
||||
fun Cursor.requireString(column: String): String? {
|
||||
@@ -31,6 +32,10 @@ fun Cursor.requireLong(column: String): Long {
|
||||
return CursorUtil.requireLong(this, column)
|
||||
}
|
||||
|
||||
fun Cursor.requireLongOrNull(column: String): Long? {
|
||||
return this.getLongOrNull(this.getColumnIndexOrThrow(column))
|
||||
}
|
||||
|
||||
fun Cursor.optionalLong(column: String): Optional<Long> {
|
||||
return CursorUtil.getLong(this, column)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user