mirror of
https://github.com/gedoor/legado.git
synced 2024-09-03 09:55:00 +08:00
优化
This commit is contained in:
parent
737f22997d
commit
b5b5987efe
@ -115,16 +115,14 @@ class SearchViewModel(application: Application) : BaseViewModel(application) {
|
||||
//添加
|
||||
searchBooksAdd.forEach { item ->
|
||||
if (searchKey == item.name) {
|
||||
for (i in copyDataS.indices) {
|
||||
val searchBook = copyDataS[i]
|
||||
for ((index, searchBook) in copyDataS.withIndex()) {
|
||||
if (searchKey != searchBook.name) {
|
||||
copyDataS.add(i, item)
|
||||
copyDataS.add(index, item)
|
||||
break
|
||||
}
|
||||
}
|
||||
} else if (searchKey == item.author) {
|
||||
for (i in copyDataS.indices) {
|
||||
val searchBook = copyDataS[i]
|
||||
for ((i, searchBook) in copyDataS.withIndex()) {
|
||||
if (searchKey != searchBook.name && searchKey == searchBook.author) {
|
||||
copyDataS.add(i, item)
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user