mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-04 03:06:41 -04:00
Fixed: RedundantHigherOrderMapUsage detekt issue to reduce the memory usages
This commit is contained in:
parent
66874849e2
commit
f9496ddfd4
@ -295,13 +295,12 @@ class ZimHostFragment : BaseFragment(), ZimHostCallbacks, ZimHostContract.View {
|
||||
}
|
||||
|
||||
private fun select(bookOnDisk: BooksOnDiskListItem.BookOnDisk) {
|
||||
val booksList: List<BooksOnDiskListItem> =
|
||||
booksAdapter.items.map {
|
||||
if (it == bookOnDisk) {
|
||||
it.isSelected = !it.isSelected
|
||||
}
|
||||
it
|
||||
val booksList: List<BooksOnDiskListItem> = booksAdapter.items.onEach {
|
||||
if (it == bookOnDisk) {
|
||||
it.isSelected = !it.isSelected
|
||||
}
|
||||
it
|
||||
}
|
||||
booksAdapter.items = booksList
|
||||
saveHostedBooks(booksList)
|
||||
if (ServerUtils.isServerStarted) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user