From 56cdd8d6af93ef175e744b3d984d9f07116b1e61 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 22 Oct 2020 18:50:17 +0600 Subject: [PATCH] remove fixing of last index due to solving that pages size must be saved in reversing of pagination --- .../micro_utils/pagination/utils/PaginationReversing.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/utils/PaginationReversing.kt b/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/utils/PaginationReversing.kt index 07104445e8c..b2761565296 100644 --- a/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/utils/PaginationReversing.kt +++ b/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/utils/PaginationReversing.kt @@ -18,13 +18,7 @@ fun Pagination.reverse(datasetSize: Long): SimplePagination { else -> Pagination( newPage, size - ).let { - if (it.lastIndex >= datasetSize) { - it.copy(size = (datasetSize - firstIndex - 1).toInt()) - } else { - it - } - } + ) } }