Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Sep 15, 2024
1 parent 8ae4940 commit c892436
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.legado.app.model.analyzeRule

import android.text.TextUtils
import androidx.annotation.Keep
import com.script.ScriptBindings
import com.script.buildScriptBindings
import com.script.rhino.RhinoScriptEngine
import io.legado.app.constant.AppPattern.JS_PATTERN
Expand Down Expand Up @@ -31,7 +30,6 @@ import java.net.URL
import java.util.regex.Pattern
import kotlin.collections.component1
import kotlin.collections.component2
import kotlin.collections.set
import kotlin.coroutines.ContinuationInterceptor
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext
Expand Down Expand Up @@ -444,15 +442,10 @@ class AnalyzeRule(
/**
* getString 类规则缓存
*/
fun splitSourceRuleCacheString(ruleStr: String?): List<SourceRule> {
private fun splitSourceRuleCacheString(ruleStr: String?): List<SourceRule> {
if (ruleStr.isNullOrEmpty()) return emptyList()
val cacheRule = stringRuleCache[ruleStr]
return if (cacheRule != null) {
cacheRule
} else {
val rules = splitSourceRule(ruleStr)
stringRuleCache[ruleStr] = rules
rules
return stringRuleCache.getOrPut(ruleStr) {
splitSourceRule(ruleStr)
}
}

Expand Down

0 comments on commit c892436

Please sign in to comment.