mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Use indices.forEach rather than forEachIndexed when we don't need item
This commit is contained in:
parent
e41ca6318a
commit
fb78676a81
1 changed files with 5 additions and 4 deletions
|
@ -349,16 +349,17 @@ class DownloadAdapter(
|
|||
if (isMultiDeleteState == value) return
|
||||
isMultiDeleteState = value
|
||||
if (!value) {
|
||||
currentList.forEachIndexed { index, _ ->
|
||||
currentList.indices.forEach { index ->
|
||||
notifyItemChanged(index)
|
||||
}
|
||||
} else notifyItemRangeChanged(0, itemCount)
|
||||
}
|
||||
|
||||
fun notifyAllSelected() {
|
||||
currentList.forEachIndexed { index, item ->
|
||||
if (item.isSelected) return@forEachIndexed
|
||||
notifyItemChanged(index)
|
||||
currentList.indices.forEach { index ->
|
||||
if (!currentList[index].isSelected) {
|
||||
notifyItemChanged(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue