优化
This commit is contained in:
@@ -80,7 +80,8 @@ object ReplaceRuleController {
|
|||||||
if (rule.isRegex) {
|
if (rule.isRegex) {
|
||||||
text.replace(
|
text.replace(
|
||||||
rule.pattern.toRegex(),
|
rule.pattern.toRegex(),
|
||||||
rule.replacement, rule.timeoutMillisecond
|
rule.replacement,
|
||||||
|
rule.getValidTimeoutMillisecond()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
text.replace(rule.pattern, rule.replacement)
|
text.replace(rule.pattern, rule.replacement)
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ data class BookChapter(
|
|||||||
displayTitle.replace(
|
displayTitle.replace(
|
||||||
item.pattern.toRegex(),
|
item.pattern.toRegex(),
|
||||||
item.replacement,
|
item.replacement,
|
||||||
item.timeoutMillisecond
|
item.getValidTimeoutMillisecond()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
displayTitle.replace(item.pattern, item.replacement)
|
displayTitle.replace(item.pattern, item.replacement)
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ data class ReplaceRule(
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Throws(NoStackTraceException::class)
|
||||||
fun checkValid() {
|
fun checkValid() {
|
||||||
if (!isValid()) {
|
if (!isValid()) {
|
||||||
throw NoStackTraceException(appCtx.getString(R.string.replace_rule_invalid))
|
throw NoStackTraceException(appCtx.getString(R.string.replace_rule_invalid))
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class ContentProcessor private constructor(
|
|||||||
mContent.replace(
|
mContent.replace(
|
||||||
item.pattern.toRegex(),
|
item.pattern.toRegex(),
|
||||||
item.replacement,
|
item.replacement,
|
||||||
item.timeoutMillisecond
|
item.getValidTimeoutMillisecond()
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
mContent.replace(item.pattern, item.replacement)
|
mContent.replace(item.pattern, item.replacement)
|
||||||
|
|||||||
Reference in New Issue
Block a user