diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt index 179b2cd9b..7d5b1858a 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt @@ -144,7 +144,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application), } } if (!scope.isActive) return - searchBooks.sortWith(Comparator { o1, o2 -> + searchBooks.sortWith { o1, o2 -> if (o1.name == searchKey && o2.name != searchKey) { 1 } else if (o1.name != searchKey && o2.name == searchKey) { @@ -168,7 +168,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application), } else { 0 } - }) + } if (!scope.isActive) return searchBooks = copyDataS upAdapter()