mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 05:27:28 +01:00
Avoid unnecessary string creation when sorting
This commit is contained in:
@@ -42,7 +42,7 @@ class SourceFilterController : SettingsController() {
|
||||
)
|
||||
|
||||
orderedLangs.forEach { lang ->
|
||||
val sources = sourcesByLang[lang].orEmpty().sortedBy { it.name.lowercase() }
|
||||
val sources = sourcesByLang[lang].orEmpty().sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER, { it.name }))
|
||||
|
||||
// Create a preference group and set initial state and change listener
|
||||
switchPreferenceCategory {
|
||||
|
||||
@@ -45,7 +45,7 @@ class LicensesController :
|
||||
viewScope.launchUI {
|
||||
val licenseItems = withIOContext {
|
||||
Libs(view.context).libraries
|
||||
.sortedBy { it.libraryName.lowercase() }
|
||||
.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER, { it.libraryName }))
|
||||
.map { LicensesItem(it) }
|
||||
}
|
||||
binding.progress.hide()
|
||||
|
||||
Reference in New Issue
Block a user