mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-18 22:57:14 +00:00
fixes in file key value repo
This commit is contained in:
parent
5e716fb9a8
commit
a3a48bbaac
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
## 0.11.12
|
## 0.11.12
|
||||||
|
|
||||||
|
* `Repos`:
|
||||||
|
* `Common`:
|
||||||
|
* `JVM`:
|
||||||
|
* Fixes in `ReadFileKeyValueRepo` methods (`values`/`keys`)
|
||||||
|
|
||||||
## 0.11.11
|
## 0.11.11
|
||||||
|
|
||||||
* `Crypto`:
|
* `Crypto`:
|
||||||
|
@ -34,7 +34,7 @@ class FileReadKeyValueRepo(
|
|||||||
override suspend fun values(pagination: Pagination, reversed: Boolean): PaginationResult<File> {
|
override suspend fun values(pagination: Pagination, reversed: Boolean): PaginationResult<File> {
|
||||||
val count = count()
|
val count = count()
|
||||||
val resultPagination = if (reversed) pagination.reverse(count) else pagination
|
val resultPagination = if (reversed) pagination.reverse(count) else pagination
|
||||||
val filesPaths = folder.list() ?.copyOfRange(resultPagination.firstIndex, resultPagination.lastIndex) ?: return emptyPaginationResult()
|
val filesPaths = folder.list() ?.copyOfRange(resultPagination.firstIndex, resultPagination.lastIndexExclusive) ?: return emptyPaginationResult()
|
||||||
if (reversed) {
|
if (reversed) {
|
||||||
filesPaths.reverse()
|
filesPaths.reverse()
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ class FileReadKeyValueRepo(
|
|||||||
override suspend fun keys(pagination: Pagination, reversed: Boolean): PaginationResult<String> {
|
override suspend fun keys(pagination: Pagination, reversed: Boolean): PaginationResult<String> {
|
||||||
val count = count()
|
val count = count()
|
||||||
val resultPagination = if (reversed) pagination.reverse(count) else pagination
|
val resultPagination = if (reversed) pagination.reverse(count) else pagination
|
||||||
val filesPaths = folder.list() ?.copyOfRange(resultPagination.firstIndex, resultPagination.lastIndex) ?: return emptyPaginationResult()
|
val filesPaths = folder.list() ?.copyOfRange(resultPagination.firstIndex, resultPagination.lastIndexExclusive) ?: return emptyPaginationResult()
|
||||||
if (reversed) {
|
if (reversed) {
|
||||||
filesPaths.reverse()
|
filesPaths.reverse()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user