Merge pull request #1101 from bushixuanqi/master

修正刚才的更新中,找到筛选器起始字符时,未重置位置导致分隔字串被划分到下一段规则的问题。
pull/1102/head
kunfei 3 years ago committed by GitHub
commit d148ba98d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/src/main/java/io/legado/app/model/analyzeRule/RuleAnalyzer.kt

@ -130,9 +130,9 @@ class RuleAnalyzer(data: String) {
*/ */
private fun findToAny(vararg seq:Char): Int { private fun findToAny(vararg seq:Char): Int {
val start = pos //声明新变量记录临时起始位置,不更改类本身的起始位置 var pos = pos //声明新变量记录匹配位置,不更改类本身的位置
while (!isEmpty) { while (pos != queue.length) {
for (s in seq) if(queue[pos] == s) return pos //匹配则返回位置 for (s in seq) if(queue[pos] == s) return pos //匹配则返回位置
@ -140,8 +140,6 @@ class RuleAnalyzer(data: String) {
} }
pos = start //匹配失败,位置回退
return -1 return -1
} }

Loading…
Cancel
Save