mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
264f94994d
commit
85c2bdb930
@ -262,10 +262,10 @@ class AnalyzeRule(
|
|||||||
/**
|
/**
|
||||||
* 获取Element
|
* 获取Element
|
||||||
*/
|
*/
|
||||||
fun getElement(ruleStr: String, mContent: Any? = null): Any? {
|
fun getElement(ruleStr: String): Any? {
|
||||||
if (TextUtils.isEmpty(ruleStr)) return null
|
if (TextUtils.isEmpty(ruleStr)) return null
|
||||||
var result: Any? = null
|
var result: Any? = null
|
||||||
val content = mContent ?: this.content
|
val content = this.content
|
||||||
val ruleList = splitSourceRule(ruleStr, true)
|
val ruleList = splitSourceRule(ruleStr, true)
|
||||||
if (content != null && ruleList.isNotEmpty()) {
|
if (content != null && ruleList.isNotEmpty()) {
|
||||||
result = content
|
result = content
|
||||||
@ -296,9 +296,9 @@ class AnalyzeRule(
|
|||||||
* 获取列表
|
* 获取列表
|
||||||
*/
|
*/
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
fun getElements(ruleStr: String, mContent: Any? = null): List<Any> {
|
fun getElements(ruleStr: String): List<Any> {
|
||||||
var result: Any? = null
|
var result: Any? = null
|
||||||
val content = mContent ?: this.content
|
val content = this.content
|
||||||
val ruleList = splitSourceRule(ruleStr, true)
|
val ruleList = splitSourceRule(ruleStr, true)
|
||||||
if (content != null && ruleList.isNotEmpty()) {
|
if (content != null && ruleList.isNotEmpty()) {
|
||||||
result = content
|
result = content
|
||||||
|
Loading…
Reference in New Issue
Block a user