mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 14:57:47 +01:00
Tweak string comparison to account for length (fixes #2831)
This commit is contained in:
parent
ea75f63dfb
commit
d5350fd719
1 changed files with 3 additions and 1 deletions
|
@ -30,7 +30,9 @@ fun String.truncateCenter(count: Int, replacement: String = "..."): String {
|
||||||
* Case-insensitive natural comparator for strings.
|
* Case-insensitive natural comparator for strings.
|
||||||
*/
|
*/
|
||||||
fun String.compareToCaseInsensitiveNaturalOrder(other: String): Int {
|
fun String.compareToCaseInsensitiveNaturalOrder(other: String): Int {
|
||||||
return String.CASE_INSENSITIVE_ORDER.then(naturalOrder()).compare(this, other)
|
return compareBy<String> { it.length }
|
||||||
|
.then(String.CASE_INSENSITIVE_ORDER)
|
||||||
|
.then(naturalOrder()).compare(this, other)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue