mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
89caa35e47
commit
245eb3e8bd
@ -154,8 +154,15 @@ class AnalyzeRule(
|
|||||||
} else {
|
} else {
|
||||||
// 键值直接访问
|
// 键值直接访问
|
||||||
result[sourceRule.rule]
|
result[sourceRule.rule]
|
||||||
}?.let {
|
}
|
||||||
replaceRegex(it.toString(), sourceRule)
|
result?.let {
|
||||||
|
if (sourceRule.replaceRegex.isNotEmpty() && it is List<*>) {
|
||||||
|
result = it.map { o ->
|
||||||
|
replaceRegex(o.toString(), sourceRule)
|
||||||
|
}
|
||||||
|
} else if (sourceRule.replaceRegex.isNotEmpty()) {
|
||||||
|
result = replaceRegex(result.toString(), sourceRule)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (sourceRule in ruleList) {
|
for (sourceRule in ruleList) {
|
||||||
@ -413,7 +420,7 @@ class AnalyzeRule(
|
|||||||
/**
|
/**
|
||||||
* getString 类规则缓存
|
* getString 类规则缓存
|
||||||
*/
|
*/
|
||||||
fun splitSourceRuleCacheString(ruleStr: String?) : List<SourceRule> {
|
fun splitSourceRuleCacheString(ruleStr: String?): List<SourceRule> {
|
||||||
if (ruleStr.isNullOrEmpty()) return emptyList()
|
if (ruleStr.isNullOrEmpty()) return emptyList()
|
||||||
val cacheRule = stringRuleCache[ruleStr]
|
val cacheRule = stringRuleCache[ruleStr]
|
||||||
return if (cacheRule != null) {
|
return if (cacheRule != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user