fix for lastIndex in reversing of pagination

This commit is contained in:
InsanusMokrassar 2020-10-22 18:48:05 +06:00
parent 864d0ffcc6
commit 899e6760e1

View File

@ -19,7 +19,7 @@ fun Pagination.reverse(datasetSize: Long): SimplePagination {
newPage, newPage,
size size
).let { ).let {
if (it.lastIndex > datasetSize) { if (it.lastIndex >= datasetSize) {
it.copy(size = (datasetSize - firstIndex - 1).toInt()) it.copy(size = (datasetSize - firstIndex - 1).toInt())
} else { } else {
it it