mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 16:23:50 +00:00
fixes in pagintion
This commit is contained in:
parent
8023fa1b76
commit
35913b95be
@ -2,6 +2,9 @@
|
||||
|
||||
## 0.2.6
|
||||
|
||||
* `Pagination`
|
||||
* Fixes in function `List#paginate`
|
||||
|
||||
## 0.2.5
|
||||
|
||||
* `Coroutines`
|
||||
|
@ -21,7 +21,7 @@ fun <T> Iterable<T>.paginate(with: Pagination): PaginationResult<T> {
|
||||
}
|
||||
|
||||
fun <T> List<T>.paginate(with: Pagination): PaginationResult<T> {
|
||||
return subList(with.firstIndex, with.lastIndex + 1).createPaginationResult(
|
||||
return subList(maxOf(with.firstIndex, 0), (minOf(with.lastIndex, lastIndex)) + 1).createPaginationResult(
|
||||
with,
|
||||
size.toLong()
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user