Removed unused 'isEmpty' utility methods

This commit is contained in:
alansley 2024-08-27 15:12:39 +10:00
parent b52048a080
commit 4809b5444b

View File

@ -21,10 +21,8 @@ import android.net.Uri
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import com.annimon.stream.Stream import com.annimon.stream.Stream
import com.google.android.mms.pdu_alt.EncodedStringValue
import java.util.Collections import java.util.Collections
import org.session.libsignal.utilities.Log import org.session.libsignal.utilities.Log
import org.thoughtcrime.securesms.components.ComposeText
object Util { object Util {
private val TAG: String = Log.tag(Util::class.java) private val TAG: String = Log.tag(Util::class.java)
@ -84,22 +82,6 @@ object Util {
return sb.toString() return sb.toString()
} }
fun isEmpty(value: Array<EncodedStringValue?>?): Boolean {
return value == null || value.size == 0
}
fun isEmpty(value: ComposeText?): Boolean {
return value == null || value.text == null || TextUtils.isEmpty(value.textTrimmed)
}
fun isEmpty(collection: Collection<*>?): Boolean {
return collection == null || collection.isEmpty()
}
fun isEmpty(charSequence: CharSequence?): Boolean {
return charSequence.isNullOrEmpty()
}
fun wait(lock: Any, timeout: Long) { fun wait(lock: Any, timeout: Long) {
try { try {
(lock as Object).wait(timeout) (lock as Object).wait(timeout)
@ -115,8 +97,7 @@ object Util {
return results return results
} }
val elements = val elements = source.split(delimiter.toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
source.split(delimiter.toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
Collections.addAll(results, *elements) Collections.addAll(results, *elements)
return results return results