Merge pull request #175 from InsanusMokrassar/0.11.12

0.11.12
This commit is contained in:
InsanusMokrassar 2022-07-02 02:50:47 +06:00 committed by GitHub
commit e5dd4363f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,12 @@
# Changelog # Changelog
## 0.11.12
* `Repos`:
* `Common`:
* `JVM`:
* Fixes in `ReadFileKeyValueRepo` methods (`values`/`keys`)
## 0.11.11 ## 0.11.11
* `Crypto`: * `Crypto`:

View File

@ -14,5 +14,5 @@ crypto_js_version=4.1.1
# Project data # Project data
group=dev.inmo group=dev.inmo
version=0.11.11 version=0.11.12
android_code_version=135 android_code_version=136

View File

@ -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()
} }