From b7e002e1fe53c7253c96a0cfb020fe8c7dd5f147 Mon Sep 17 00:00:00 2001 From: bushixuanqi <57338301+bushixuanqi@users.noreply.github.com> Date: Fri, 9 Jul 2021 17:04:53 +0800 Subject: [PATCH] Update RuleAnalyzer.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正与简化 --- .../java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt b/app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt index 5fd4aa346..aaeda91ab 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt @@ -432,11 +432,8 @@ class RuleAnalyzer(data: String, code: Boolean = false) { pos += inner.length //拉出字段不平衡,inner只是个普通字串,跳到此inner后继续匹配 } - //最初起点与当前规则起点相同,证明无替换成功的内嵌规则,返回空字符串。否则返回替换后的字符串 - return if (startX == startXS) "" else { - st.append(queue.substring(pos)) //压入剩余字符串 - st.toString() - } + st.append(queue.substring(startX)) //压入剩余字符串 + return st.toString() } companion object {