mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-02 16:52:55 +01:00
fix: Check index of pattern in string instead of the other way around
This commit is contained in:
parent
46d8ef6f88
commit
96a1e4680d
@ -1,7 +1,6 @@
|
|||||||
package app.revanced.integrations.youtube.patches.components;
|
package app.revanced.integrations.youtube.patches.components;
|
||||||
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
@ -15,7 +14,6 @@ import java.util.Spliterator;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import app.revanced.integrations.shared.Logger;
|
import app.revanced.integrations.shared.Logger;
|
||||||
import app.revanced.integrations.shared.Utils;
|
|
||||||
import app.revanced.integrations.shared.settings.BooleanSetting;
|
import app.revanced.integrations.shared.settings.BooleanSetting;
|
||||||
import app.revanced.integrations.shared.settings.BaseSettings;
|
import app.revanced.integrations.shared.settings.BaseSettings;
|
||||||
import app.revanced.integrations.youtube.ByteTrieSearch;
|
import app.revanced.integrations.youtube.ByteTrieSearch;
|
||||||
@ -124,7 +122,7 @@ class StringFilterGroup extends FilterGroup<String> {
|
|||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
for (String pattern : filters) {
|
for (String pattern : filters) {
|
||||||
if (!string.isEmpty()) {
|
if (!string.isEmpty()) {
|
||||||
final int indexOf = pattern.indexOf(string);
|
final int indexOf = string.indexOf(pattern);
|
||||||
if (indexOf >= 0) {
|
if (indexOf >= 0) {
|
||||||
matchedIndex = indexOf;
|
matchedIndex = indexOf;
|
||||||
matchedLength = pattern.length();
|
matchedLength = pattern.length();
|
||||||
|
Loading…
Reference in New Issue
Block a user