mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-12-01 00:02:55 +01:00
fix: correct implementation of indexOf (#5)
LithoAdRemoval.indexOf never increments the index for the outer loop, causing an infinite loop
This commit is contained in:
parent
14c5d21f9d
commit
4da053804b
@ -188,14 +188,17 @@ public class LithoAdRemoval {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
while (i < array.length - target.length + 1 ){
|
||||
for (int i = 0; i < array.length - target.length + 1; i++) {
|
||||
boolean targetFound = true;
|
||||
for (int j = 0; j < target.length; j++) {
|
||||
if (array[i+j] != target[j]) {
|
||||
targetFound = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
if (targetFound) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user