优化
This commit is contained in:
@@ -257,9 +257,6 @@ class EpubFile(var book: Book) {
|
|||||||
} else {
|
} else {
|
||||||
parseFirstPage(chapterList, refs)
|
parseFirstPage(chapterList, refs)
|
||||||
parseMenu(chapterList, refs, 0)
|
parseMenu(chapterList, refs, 0)
|
||||||
val lh = LinkedHashSet(chapterList)
|
|
||||||
chapterList.clear()
|
|
||||||
chapterList.addAll(lh)
|
|
||||||
for (i in chapterList.indices) {
|
for (i in chapterList.indices) {
|
||||||
chapterList[i].index = i
|
chapterList[i].index = i
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ object LocalBook {
|
|||||||
throw TocEmptyException(appCtx.getString(R.string.chapter_list_empty))
|
throw TocEmptyException(appCtx.getString(R.string.chapter_list_empty))
|
||||||
}
|
}
|
||||||
val lh = LinkedHashSet(chapters)
|
val lh = LinkedHashSet(chapters)
|
||||||
|
lh.forEachIndexed { index, bookChapter -> bookChapter.index = index }
|
||||||
return ArrayList(lh)
|
return ArrayList(lh)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user