MangaReader.to: simplify parseAuthor code (#13341)

This commit is contained in:
stevenyomi 2022-09-06 22:10:49 +08:00 committed by GitHub
parent 6f4651023b
commit 659ad4b264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -133,12 +133,10 @@ open class MangaReader(
return
}
}
val nodes = childNodes()
val authorList = ArrayList<String>(count)
val artistList = ArrayList<String>(count)
for ((index, author) in authors.withIndex()) {
val nodeIndex = nodes.indexOf(author)
val textNode = nodes.getOrNull(nodeIndex + 1) as? TextNode
val textNode = author.nextSibling() as? TextNode
val list = if (textNode != null && "(Art)" in textNode.wholeText) artistList else authorList
list.add(text[index])
}