feat: 优化代码

pull/105/head
kunfei 5 years ago
parent 916d651ffa
commit d04ded3910
  1. 4
      app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt

@ -12,9 +12,9 @@ import io.legado.app.model.Debug
import io.legado.app.model.analyzeRule.AnalyzeRule import io.legado.app.model.analyzeRule.AnalyzeRule
import io.legado.app.model.analyzeRule.AnalyzeUrl import io.legado.app.model.analyzeRule.AnalyzeUrl
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlin.coroutines.resume import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine
object BookChapterList { object BookChapterList {
@ -24,7 +24,7 @@ object BookChapterList {
body: String?, body: String?,
bookSource: BookSource, bookSource: BookSource,
baseUrl: String baseUrl: String
): List<BookChapter> = suspendCoroutine { block -> ): List<BookChapter> = suspendCancellableCoroutine { block ->
try { try {
val chapterList = ArrayList<BookChapter>() val chapterList = ArrayList<BookChapter>()
body ?: throw Exception( body ?: throw Exception(

Loading…
Cancel
Save