diff --git a/CHANGELOG.md b/CHANGELOG.md index ac8d1fecfa3..591639e8deb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## 0.11.12 +* `Repos`: + * `Common`: + * `JVM`: + * Fixes in `ReadFileKeyValueRepo` methods (`values`/`keys`) + ## 0.11.11 * `Crypto`: diff --git a/repos/common/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/FileKeyValueRepo.kt b/repos/common/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/FileKeyValueRepo.kt index 5c7fb0121b3..c35376242d3 100644 --- a/repos/common/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/FileKeyValueRepo.kt +++ b/repos/common/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/FileKeyValueRepo.kt @@ -34,7 +34,7 @@ class FileReadKeyValueRepo( override suspend fun values(pagination: Pagination, reversed: Boolean): PaginationResult { val count = count() 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) { filesPaths.reverse() } @@ -47,7 +47,7 @@ class FileReadKeyValueRepo( override suspend fun keys(pagination: Pagination, reversed: Boolean): PaginationResult { val count = count() 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) { filesPaths.reverse() }