diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabaseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabaseController.kt index 6bcfc6e57..a47075667 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabaseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/database/ClearDatabaseController.kt @@ -88,11 +88,9 @@ class ClearDatabaseController : when (item.itemId) { R.id.action_select_all -> adapter.selectAll() R.id.action_select_inverse -> { - val currentSelection = adapter.selectedPositionsAsSet - val invertedSelection = (0..adapter.itemCount) - .filterNot { currentSelection.contains(it) } - currentSelection.clear() - currentSelection.addAll(invertedSelection) + adapter.currentItems.forEachIndexed { index, _ -> + adapter.toggleSelection(index) + } } } updateFab()