diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt index 67e86d129..e4c2829e8 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeByJSonPath.kt @@ -13,10 +13,9 @@ class AnalyzeByJSonPath { private lateinit var ctx: ReadContext fun parse(json: Any): AnalyzeByJSonPath { - ctx = if (json is String) { - JsonPath.parse(json) - } else { - JsonPath.parse(json) + ctx = when (json) { + is String -> JsonPath.parse(json) + else -> JsonPath.parse(json) } return this }