style(lint): Unnecessary lambda with trim()

The lambda argument ({ it <= ' ' }) is unnecessary

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2025-05-14 10:16:29 +02:00
parent 87f1319145
commit 240ec8f98e
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
9 changed files with 17 additions and 17 deletions

View File

@ -212,7 +212,7 @@ class ServerSelectionActivity : BaseActivity() {
@Suppress("Detekt.TooGenericExceptionCaught") @Suppress("Detekt.TooGenericExceptionCaught")
private fun checkServerAndProceed() { private fun checkServerAndProceed() {
dispose() dispose()
var url: String = binding.serverEntryTextInputEditText.text.toString().trim { it <= ' ' } var url: String = binding.serverEntryTextInputEditText.text.toString().trim()
showserverEntryProgressBar() showserverEntryProgressBar()
if (binding.importOrChooseProviderText.visibility != View.INVISIBLE) { if (binding.importOrChooseProviderText.visibility != View.INVISIBLE) {
binding.importOrChooseProviderText.visibility = View.INVISIBLE binding.importOrChooseProviderText.visibility = View.INVISIBLE

View File

@ -36,9 +36,9 @@ class AdvancedUserItem(
private val viewThemeUtils: ViewThemeUtils, private val viewThemeUtils: ViewThemeUtils,
private val actionRequiredCount: Int private val actionRequiredCount: Int
) : AbstractFlexibleItem<UserItemViewHolder>(), IFilterable<String?> { ) : AbstractFlexibleItem<UserItemViewHolder>(), IFilterable<String?> {
override fun equals(o: Any?): Boolean { override fun equals(other: Any?): Boolean {
return if (o is AdvancedUserItem) { return if (other is AdvancedUserItem) {
model == o.model model == other.model
} else { } else {
false false
} }
@ -98,7 +98,7 @@ class AdvancedUserItem(
return model.displayName != null && return model.displayName != null &&
Pattern Pattern
.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL) .compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
.matcher(model.displayName!!.trim { it <= ' ' }) .matcher(model.displayName!!.trim())
.find() .find()
} }

View File

@ -57,10 +57,10 @@ class ContactItem(
return model.displayName != null && return model.displayName != null &&
( (
Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL) Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
.matcher(model.displayName!!.trim { it <= ' ' }) .matcher(model.displayName!!.trim())
.find() || .find() ||
Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL) Pattern.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
.matcher(model.calculatedActorId!!.trim { it <= ' ' }) .matcher(model.calculatedActorId!!.trim())
.find() .find()
) )
} }

View File

@ -319,7 +319,7 @@ class ConversationItem(
return model.displayName != null && return model.displayName != null &&
Pattern Pattern
.compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL) .compile(constraint!!, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
.matcher(model.displayName!!.trim { it <= ' ' }) .matcher(model.displayName.trim())
.find() .find()
} }

View File

@ -292,9 +292,9 @@ class ParticipantItem(
override fun filter(constraint: String?): Boolean { override fun filter(constraint: String?): Boolean {
return model.displayName != null && ( return model.displayName != null && (
Pattern.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL) Pattern.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
.matcher(model.displayName!!.trim { it <= ' ' }).find() || .matcher(model.displayName!!.trim()).find() ||
Pattern.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL) Pattern.compile(constraint, Pattern.CASE_INSENSITIVE or Pattern.LITERAL)
.matcher(model.calculatedActorId!!.trim { it <= ' ' }).find() .matcher(model.calculatedActorId!!.trim()).find()
) )
} }

View File

@ -373,7 +373,7 @@ class MessageInputFragment : Fragment() {
if (editable.subSequence( if (editable.subSequence(
editable.getSpanStart(mentionSpan), editable.getSpanStart(mentionSpan),
editable.getSpanEnd(mentionSpan) editable.getSpanEnd(mentionSpan)
).toString().trim { it <= ' ' } != mentionSpan.label ).toString().trim() != mentionSpan.label
) { ) {
editable.removeSpan(mentionSpan) editable.removeSpan(mentionSpan)
} }

View File

@ -239,7 +239,7 @@ data class ChatMessage(
} }
} }
return if (!messageTypesToIgnore.contains(getCalculateMessageType())) { return if (!messageTypesToIgnore.contains(getCalculateMessageType())) {
message!!.trim { it <= ' ' } message!!.trim()
} else { } else {
null null
} }

View File

@ -102,7 +102,7 @@ abstract class TalkDatabase : RoomDatabase() {
.getString(R.string.nc_app_product_name) .getString(R.string.nc_app_product_name)
.lowercase(Locale.getDefault()) .lowercase(Locale.getDefault())
.replace(" ", "_") .replace(" ", "_")
.trim { it <= ' ' } + .trim() +
".sqlite" ".sqlite"
return Room return Room

View File

@ -401,14 +401,14 @@ object DisplayUtils {
if (url!!.length >= HTTP_MIN_LENGTH && if (url!!.length >= HTTP_MIN_LENGTH &&
HTTP_PROTOCOL.equals(url.substring(0, HTTP_MIN_LENGTH), ignoreCase = true) HTTP_PROTOCOL.equals(url.substring(0, HTTP_MIN_LENGTH), ignoreCase = true)
) { ) {
return url.substring(HTTP_PROTOCOL.length).trim { it <= ' ' } return url.substring(HTTP_PROTOCOL.length).trim()
} }
return if (url.length >= HTTPS_MIN_LENGTH && return if (url.length >= HTTPS_MIN_LENGTH &&
HTTPS_PROTOCOL.equals(url.substring(0, HTTPS_MIN_LENGTH), ignoreCase = true) HTTPS_PROTOCOL.equals(url.substring(0, HTTPS_MIN_LENGTH), ignoreCase = true)
) { ) {
url.substring(HTTPS_PROTOCOL.length).trim { it <= ' ' } url.substring(HTTPS_PROTOCOL.length).trim()
} else { } else {
url.trim { it <= ' ' } url.trim()
} }
} }
@ -420,7 +420,7 @@ object DisplayUtils {
*/ */
fun beautifyTwitterHandle(handle: String?): String { fun beautifyTwitterHandle(handle: String?): String {
return if (handle != null) { return if (handle != null) {
val trimmedHandle = handle.trim { it <= ' ' } val trimmedHandle = handle.trim()
if (TextUtils.isEmpty(trimmedHandle)) { if (TextUtils.isEmpty(trimmedHandle)) {
return "" return ""
} }