From 632f3066a7fcf8002a2900d6b6b60c34cf627ec3 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 15 Dec 2019 19:07:14 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt b/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt index fdb9e4e2b..d9c57c4ce 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt @@ -54,8 +54,8 @@ data class TextChapter( fun getReadLength(pageIndex: Int): Int { var length = 0 - val maxIndex = min(pageIndex, pageLines.lastIndex) - for (index in 0..maxIndex) { + val maxIndex = min(pageIndex, pageLines.size) + for (index in 0 until maxIndex) { length += pageLengths[index] } return length