fix: Check index of pattern in string instead of the other way around

This commit is contained in:
oSumAtrIX 2024-03-26 04:47:21 +01:00
parent 46d8ef6f88
commit 96a1e4680d
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -1,7 +1,6 @@
package app.revanced.integrations.youtube.patches.components;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
@ -15,7 +14,6 @@ import java.util.Spliterator;
import java.util.function.Consumer;
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.BaseSettings;
import app.revanced.integrations.youtube.ByteTrieSearch;
@ -124,7 +122,7 @@ class StringFilterGroup extends FilterGroup<String> {
if (isEnabled()) {
for (String pattern : filters) {
if (!string.isEmpty()) {
final int indexOf = pattern.indexOf(string);
final int indexOf = string.indexOf(pattern);
if (indexOf >= 0) {
matchedIndex = indexOf;
matchedLength = pattern.length();