mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
21c40b08d6
commit
b68cc7b4d9
@ -75,10 +75,13 @@ class SearchContentViewModel(application: Application) : BaseViewModel(applicati
|
|||||||
|
|
||||||
private fun searchPosition(pattern: String): List<Int> {
|
private fun searchPosition(pattern: String): List<Int> {
|
||||||
val position: MutableList<Int> = mutableListOf()
|
val position: MutableList<Int> = mutableListOf()
|
||||||
if (mContent.indexOf(pattern) >= 0) {
|
var index = mContent.indexOf(pattern)
|
||||||
|
if (index >= 0) {
|
||||||
//搜索到内容允许净化
|
//搜索到内容允许净化
|
||||||
if (book?.getUseReplaceRule() ?: false) mContent = contentProcessor!!.replaceContent(mContent)
|
if (book!!.getUseReplaceRule()) {
|
||||||
var index = mContent.indexOf(pattern)
|
mContent = contentProcessor!!.replaceContent(mContent)
|
||||||
|
index = mContent.indexOf(pattern)
|
||||||
|
}
|
||||||
while (index >= 0) {
|
while (index >= 0) {
|
||||||
position.add(index)
|
position.add(index)
|
||||||
index = mContent.indexOf(pattern, index + 1)
|
index = mContent.indexOf(pattern, index + 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user