diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/materialdialogs/QuadStateMultiChoiceDialogAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/materialdialogs/QuadStateMultiChoiceDialogAdapter.kt index 6fa4dc4ca8..f3a9f11fdb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/materialdialogs/QuadStateMultiChoiceDialogAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/materialdialogs/QuadStateMultiChoiceDialogAdapter.kt @@ -60,16 +60,10 @@ internal class QuadStateMultiChoiceDialogAdapter( else -> QuadStateCheckBox.State.CHECKED.ordinal } currentSelection = newSelection.toIntArray() - val selectedItems = this.items.pullIndices(this.currentSelection) - selection?.invoke(dialog, currentSelection, selectedItems) - } - - internal inline fun List.pullIndices(indices: IntArray): List { - return mutableListOf().apply { - for (index in indices) { - add(this@pullIndices[index]) - } + val selectedItems = this.items.filterIndexed { index, _ -> + currentSelection[index] != 0 } + selection?.invoke(dialog, currentSelection, selectedItems) } override fun onCreateViewHolder(