mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Improve performance from thread being updated to data available to render.
This commit is contained in:
@@ -22,23 +22,6 @@ fun String.asListContains(item: String): Boolean {
|
||||
.any { item.startsWith(it) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns a multi-line string into a single-line string stripped of indentation, separated by spaces instead of newlines.
|
||||
*
|
||||
* e.g.
|
||||
*
|
||||
* a
|
||||
* b
|
||||
* c
|
||||
*
|
||||
* turns into
|
||||
*
|
||||
* a b c
|
||||
*/
|
||||
fun String.toSingleLine(): String {
|
||||
return this.trimIndent().split("\n").joinToString(separator = " ")
|
||||
}
|
||||
|
||||
fun String?.emptyIfNull(): String {
|
||||
return this ?: ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user